in reply to Re^2: Date::Format handling of ISO week number format
in thread Date::Format handling of ISO week number format
Ah, well that sucks. I would file a bug report. Since that doesn't work, I shall return to my first idea, which is to use Date::Calc. I didn't even know about Date::Format until you pointed it out.
#! /usr/local/bin/perl -w use strict; use Date::Calc 'Week_of_Year'; my ($y, $m, $d) = split m{/}, shift || '2007/12/31'; my ($week,$year) = Week_of_Year($y, $m, $d); printf "%04d-W%02d\n", $year, $week;
You might want to wrap that up in a little routine and be done with it. It will certainly be far faster than using Date::Manip
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Date::Format handling of ISO week number format
by Oberon (Monk) on Jan 16, 2008 at 23:48 UTC |