in reply to Date::Manip and Date::Calc
How about a solution that doesn't use any non-standard modules?
--#!/usr/bin/perl -w use strict; use Time::Local; use POSIX 'strftime'; my @now = localtime; $now[4]++; if ($now[4] == 12) { $now[4] = 0; $now[5]++; } $now[3] = 1; my @then = localtime(timelocal(0, 0, 12, @now[3 .. 5]) - 86_400); print strftime '%Y-%m-%d', @then;
"The first rule of Perl club is you don't talk about Perl club."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Date::Manip and Date::Calc
by blakem (Monsignor) on Oct 22, 2001 at 21:50 UTC | |
by davorg (Chancellor) on Oct 22, 2001 at 22:09 UTC |