in reply to Date::Format handling of ISO week number format
I'm not sure whether you want to parse these date formats, or produce them. Since you mention Date::Format, I assume you want to format them. In which case, what's wrong with the following?
use strict; use Date::Format 'time2str'; print time2str("%Y-W%W", time);
If you want to zero-fill the week numbers, you have to use the slightly more cumbersome:
my $t = time; print time2str("%Y-W", $t) . sprintf("%02d",time2str("%W", $t));
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Date::Format handling of ISO week number format
by Oberon (Monk) on Jan 15, 2008 at 20:06 UTC | |
by grinder (Bishop) on Jan 16, 2008 at 11:50 UTC | |
by Oberon (Monk) on Jan 16, 2008 at 23:48 UTC |