If this is on a standard gregorian calendar, then this will include leap days and so I might expect 366 days resulting.
If you don't want to include these leap days, it sounds like you want to perform your analysis with respect to some form of categorisation that does not involve a calendar (this is inferred by the result you expect).
Example: consider comparing data on one calendar with another calendar. Comparing times becomes impossible (apples and oranges). We must infer a way of comparing between these data sets that does not involve calendars. One way of categorising these two data sets might be on season for example and doing away with the times.
If you mean to convert your coordinate to a different calendar, (i.e. still infer specific times with calendars), then do so at your own risk and you will have to calculate this yourself for your own purposes.