Bug in getDayOfYear function

Bug in getDayOfYear function


I have found an issue with the subject function. For my testing I have the following:

The values are:
input.Loan_Date = 12-16-2014 16:00:00
input.Claim_Date = 02-16-2015

and I have the following code. 

input.Number_of_Days = (input.Claim_Date.getDayOfYear()  -  input.Loan_Date.getDayOfYear());

The result:
input.Number_of_Days = -303

I have run a few test data and it seems this bug occurs whenever the year are different. If it's the same year then the getDayOfYear function works Ok.

Has someone encountered this issue?