http://www.perlmonks.org?node_id=551238
Description: Today I faced with small problem. I prepared a chart where data was split by weeks. It was very easy except one thing: display the first day of the week instead of week number. Here is a one way to do it (the main idea belongs to my co-worker Igor) P. S. Other way is to use Date::Calc - ($y, $m, $d) = Monday_of_Week($week, $year); Updated: added support of time zone.
use Time::Local qw(timelocal timegm);
use POSIX qw(strftime);

sub get_date_by_week {
    my $week = shift || 1;
    my $year = shift || (localtime)[5];
    my $pattern = shift || '%d/%m';
    my $t = timegm(0, 0, 0, 1, 0, $year);
    my $w = (gmtime($t))[6];
    $w = ($w - 2) % 7 + 1;
    my $wc = $week * 7 - $w;
    return strftime($pattern, localtime($t + $wc * 24 * 3600));
}