I have used this little snippet for a lot of my programs. I know I'm jumping in line 
here but maybe this will work for you too:

my @days = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
my @months = 
("January","February","March","April","May","June","July","August","September","October","November","December");

($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my $year = $year + 1900;

then I just called it like this:
$days[$wday], $months[$mon] $mday, $year

Mark Bergeron

-----Original Message-----
From: "$Bill Luebkert"<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Date: Tue May 21 15:25:06 PDT 2002
Subject: Re: Date question

>[EMAIL PROTECTED] wrote:
>
>> I have a question about my date snippet.
>> 
>> my ($mday, $mon, $year) = (localtime(time))[3..5];
>> my $pagedate = sprintf "%02u/%02u/%u", $mon + 1, $mday,
>>  $year + 1900;
>> 
>> The above will print out the date like "05/21/2002" 
>> 
>> How can I create the date exactically to the same day but
>>  to the following month?
>> 
>> Then I would have: start date "05/21/2002"
>>                    end date   "06/21/2002"
>
>
>Maybe add 1 to $mon ???
>
>
>> Or for whatever date....
>
>
>my ($mday, $mon, $year) = (localtime (time  + $diff_in_secs_to_new_date))[3..5];
>
>then feed the vars to timelocal (Time::Local) to get your future epoch time.
>
>You can flip back and forth between localtime and timelocal to get
>exact days of month or month of year, etc.
>
>-- 
>   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
>  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
>   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
>-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/
>
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___________________________________________________
GO.com Mail                                    
Get Your Free, Private E-mail at http://mail.go.com


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to