Today March 10, 2010 is ...
Day 69
Day of year is a number between 1 and 366 (January 1 is day 1).
Some application use 'ISO day of year' numbers, this is a number between 1 and 371, day 1 of the year is Monday of the first ISO week (where the first Thursday of the new year is in week 1 ?).
Current day of the year in ...
| Perl | my $dayNumber = POSIX::strftime("%j", gmtime time); Replace time with other epochs for other days. |
| PHP | $dayNumber = date("z") + 1; or date("z", epoch) + 1 for other day numbers. date("z") starts counting from 0 (0 through 365)! |
| Python | day_of_year = datetime.now().timetuple().tm_yday |
| MySQL | SELECT DAYOFYEAR(NOW()) Day number between 1 and 366. Replace now() with other dates eg. SELECT DAYOFYEAR('2008-02-20'); |
| Microsoft Access | DatePart("y",Date) |
| JavaScript | See this page |
Also see: Current week number