Hi Wiggins and Gunnar

Thanks for your help. I come from an excel vba background where date
formatting is a simpler process. This is what I used:

$date_next_string = strftime("%d-%b-%Y %H:%M", localtime($date_next));



From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] 
Sent: Friday, 27 August 2004 9:35 a.m.
To: John Bruin; [EMAIL PROTECTED]
Subject: Re: Newbie needs help changing date format

> Hi
> 
> I have a list of dates that have been converted to epoch seconds,
processed
> and then converted back to a string (using timelocal). The resulting 
> date format is:-
> 
> "Wed Mar 16 22:10:16 2004"
> 
> What is the easiest way to convert this format (or epoch seconds) to
> "16-Mar-2004 22:10" - preferrably using a standard module as I don't 
> have administrator rights.
> 
> Thanks
> John
> 

There are any number of modules that can do this.

Alternatively you can either use 'localtime' to get the pieces you want and
then do the conversions yourself, or you can use the 'strftime'
function of the POSIX (standard on POSIX systems) module.

perldoc POSIX
perldoc -f localtime

For more information. Note that POSIX relies on the underlying C header for
your system so you may have to 'man strftime' for the exact details, despite
the fact that it should be standard at least one part of it is not across
all systems (grrr... %z/%Z for the curious, I hit this one before).

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>
<http://learn.perl.org/first-response>






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to