in reply to Date::Manip UnixDate, Hours minutes and seconds are not returned correctly

Do you know why ?

Because 'today' is a day, not a time of day. Try 'now' if you want date and time.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Date::Manip UnixDate, Hours minutes and seconds are not returned correctly

Replies are listed 'Best First'.
Re^2: Date::Manip UnixDate, Hours minutes and seconds are not returned correctly
by Anonymous Monk on Sep 30, 2011 at 01:42 UTC

    I ran the command line in Fedora

    [kia@home bin]$ perl -le "use Date::Manip qw/UnixDate/;print UnixDate +('today','%Y-%m-%d-%H-%M-%S');" 2011-09-30-08-39-24

    So different behaviours returned for linux and Mac.

    I tried 'now' in linux, and working, i'll ask my friend to use now, and see the result

    Thank you

      So different behaviours returned for linux and Mac.

      Just a guess. Different versions of D::M?

      perl -MDate::Manip -E"say $Date::Manip::VERSION" 6.25 perl -MDate::Manip=UnixDate -E"say UnixDate('today','%Y-%m-%d-%H-%M-%S +')" 2011-09-30-00-00-00 perl -MDate::Manip=UnixDate -E"say UnixDate('now','%Y-%m-%d-%H-%M-%S') +" 2011-09-30-02-50-27

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I am using 5.54, not sure with my friend, will ask him and will let you know.

      The documentation Date::Manip::Changes5to6 is very clear about this:

      The words "today", "tomorrow", and "yesterday" in 5.xx referred to the time now, 24 hours in the future, and 24 hours in the past respectively.

      As of 6.00, these are treated strictly as date strings, so they are the current day, the day before, or the day after at the time 00:00:00.

      The string "now" still refers to the current date and time.