"[EMAIL PROTECTED]" wrote:
> 
> Hi all,

Hello,

>         as part of my program i want to jump from 00:00:00 on the
> first of any
> given month to 00:00:00 on the first of the next month. i wrote a subroutine to
> calculate this. the relevent code looks like this
> 
> [snip code]


$ perl -le'use Time::Local;
my @today = (0,0,0,1, (localtime)[4,5]);
print scalar localtime timelocal @today;
$today[4] == 11 ? {$today[4] = 0, $today[5]++} : $today[4]++;
print scalar localtime timelocal @today;
$today[4] == 11 ? {$today[4] = 0, $today[5]++} : $today[4]++;
print scalar localtime timelocal @today;
'
Sat Dec  1 00:00:00 2001
Tue Jan  1 00:00:00 2002
Fri Feb  1 00:00:00 2002



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to