# day_of_year

Definition: | integer i = day_of_year(object y, integer m=0, d=0)
Description: | y: a year such as 2022, or a result from date() or a timedate. m: a month 1..12, ignored/overidden if y is a sequence. d: a day 1..31, ignored/overidden if y is a sequence. Returns an integer from 1 to 366.
pwa/p2js: | Supported.
Comments: | Uses the proper rules for leap years. Obviously this functionality is required as part of date(), and has been made available for general use. Not suitable for use with years prior to the introduction of the Gregorian calendar. Returns 0 if y < 1752.
Example: |
    ?{day_of_year(2015,1,1),day_of_year(2015,12,31)}    -- prints {1,365}
Implementation: | See builtins\pdates.e (an autoinclude) for details of the actual implementation.
See Also: | date, time