in reply to Re^2: Getting Ordinal Number of a Week in a Given Date
in thread Getting Ordinal Number of a Week in a Given Date

Interesting, and apologies. Does Date::Calc take this into account? Presumably POSIX::strftime is locale sensitive?
  • Comment on Re^3: Getting Ordinal Number of a Week in a Given Date

Replies are listed 'Best First'.
Re^4: Getting Ordinal Number of a Week in a Given Date
by Not_a_Number (Prior) on Sep 01, 2006 at 13:30 UTC
    Does Date::Calc take this into account?

    Yes:

    use strict; use warnings; use Date::Calc qw ( Decode_Date_EU Week_of_Year ); my @date = ( 2006, 1, 1 ); print Week_of_Year( @date );

    Prints 522005, ie the 52nd week of 2005.

Re^4: Getting Ordinal Number of a Week in a Given Date
by Skeeve (Parson) on Sep 01, 2006 at 12:48 UTC
    I don't think so:
    perl -MPOSIX -MTime::Local -le'print strftime q/%W/, localtime timelocal(0,0,0,1,0,2005)'
    Result: 00

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e