in reply to Re^2: Getting times (weeks, days, hours, minutes, seconds)
in thread Getting times (weeks, days, hours, minutes, seconds)

Unfortunately, it doesn't produce the result one would expect because DateTime(::Duration) realises that not every minute has 60 seconds. Some are longer due to leap seconds.

From the docs, the only conversions possible are:

Ah, so, Date::Time favours geek correctness over usability. And by doing so, it's not POSIX compliant (as POSIX says leap seconds are to be ignored). While taking care of leap seconds is useful in some cases, stubbornly refusing to do second/minute conversion because of a leap second every few years most of society ignores without problems makes the module far less useful than it could be.
  • Comment on Re^3: Getting times (weeks, days, hours, minutes, seconds)

Replies are listed 'Best First'.
Re^4: Getting times (weeks, days, hours, minutes, seconds)
by ikegami (Patriarch) on Jul 05, 2010 at 16:18 UTC

    Ah, so, Date::Time favours geek correctness over usability.

    First, it's DateTime, not Date::Time. The purpose of the module is to manipulate date-times, not time durations. DateTime::Duration is a helper object to help DateTime do date arithmetic. It's not designed to contain a result.

    When using the module as intended, it provides both a correct mode and a lax mode (the 'floating' time zone) for usability, so your claim is false.