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

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

  • Comment on Re^2: Date::Manip UnixDate, Hours minutes and seconds are not returned correctly
  • Download Code

Replies are listed 'Best First'.
Re^3: Date::Manip UnixDate, Hours minutes and seconds are not returned correctly
by BrowserUk (Patriarch) on Sep 30, 2011 at 01:52 UTC
    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.

Re^3: Date::Manip UnixDate, Hours minutes and seconds are not returned correctly
by ambrus (Abbot) on Sep 30, 2011 at 19:05 UTC

    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.