Week number in Perl
Getting the week number for a date in Perl can be easily achieved using the
POSIX module. The
strftime takes a format string and a unix timestamp as
Get the current week number and print it.
use strict; use Time::Local; use POSIX qw(strftime); my $weekNumber = POSIX::strftime("%V", gmtime time); print "Week number:$weekNumber";
comments powered by Disqus