> 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>