in reply to Way to calculate day-of-the-week

Hello.

There is a great module (meta-module) called Task::Kensho, that groups tried things that people use for common purposes under one umbrella. Look at the Dates section for modules related to Dates.

I would recommend DateTime, with the following usage (from module synopsis):

use DateTime; $dt = DateTime->new( year => 1964, month => 10, day => 16, ); $dow = $dt->day_of_week; # 1-7 (Monday is 1)

- Luke

Replies are listed 'Best First'.
Re^2: Way to calculate day-of-the-week
by BillKSmith (Monsignor) on Dec 24, 2014 at 13:44 UTC
    I have never had a time related problem that I could not do with Date::Time. It probably is always overkill, but it gets the job done. Why look further?
    Bill

      There are some reasons you won't find Date::Time under the Task::Kensho modules.

      For one, look at this review of the module you mentioned. Or the fact that the module synopsis still starts with the line:

      This is just some suggestions, as nothing is implemented yet. I'm open to critisism.

      The fact that you 'never had a time related problem' that you could not do with one particular tool is still not enough to be sure that there is no reason to look further into other tools. Even curiosity is reason enough to look further.

      As always, TIMTOWTDI.

      - Luke

        The module you and Bill (accidentally) linked is not the DateTime being discussed/recommended I think.