To determine the number of the current week in php, one line is enough
date("W", time()); How to do the same on pearl? Found only a couple of examples on a few lines. Couldn't it be somehow simpler?
To determine the number of the current week in php, one line is enough
date("W", time()); How to do the same on pearl? Found only a couple of examples on a few lines. Couldn't it be somehow simpler?
perl -MTime::Piece -E '$t = localtime; say $t->week' 3 You can use the strftime() function from the POSIX package. the parameters and the result are the same:
$ perl -e 'use POSIX qw(strftime); print strftime "%W", localtime;' 03 Source: https://ru.stackoverflow.com/questions/484227/
All Articles