DelphiFAQ Home Search:
General :: Programming :: perl
General questions about perl.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Determine the day of the year


How can I find out what day of the year it is?


Use localtime() and either simply access element [7]:

my $day_of_year = (localtime(time()))[7];
 # better to read:
 use Time::localtime;
 my $day_of_year = localtime(time())->yday;  

Generated 12:01:30 on Feb 20, 2020