use strict; use Date::Format 'time2str'; print time2str("%Y-W%W", time); #### my $t = time; print time2str("%Y-W", $t) . sprintf("%02d",time2str("%W", $t));