in reply to Time / Date Arithmetic Module Recommendations
The kitchen sink module is Date::Manip. It's pretty up front about where and when you should use it and why you might not - see the 'SHOULD I USE DATE::MANIP' section in the docs.
use strict; use warnings; use Date::Manip; Date_Init ('DateFormat = NZ', 'TZ = NZST'); my $today = ParseDate ('today'); DateCalc ($today, '25 december ' . UnixDate ($today, '%Y')) =~ /\d+:\d ++:(\d+):(\d+)/; print $1 * 7 + $2, ' sleeps until Xmas';
Prints:
76 sleeps until Xmas
On most *nix boxes you shouldn't need the Date_Init, but you will need it on most Windows boxes. Your time zone may be different than mine too. ;)
<p.Update updated for children.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Time / Date Arithmetic Module Recommendations
by ikegami (Patriarch) on Oct 09, 2008 at 03:42 UTC | |
by GrandFather (Saint) on Oct 09, 2008 at 03:46 UTC | |
|
Re^2: Time / Date Arithmetic Module Recommendations
by ikegami (Patriarch) on Oct 09, 2008 at 04:05 UTC |