[rt-devel] Date in Unix format

arclight at jump.net arclight at jump.net
Tue Sep 26 02:47:13 EDT 2000


Hi,

FWIW, I prefer

use POSIX qw(strftime);
my $nicedate = strftime("%d/%m/%Y", localtime($unixtime));
# or
$nicedate = POSIX::strftime("%d/%m/%Y", localtime($unixtime));

Advantage: uses core perl; no need to install extra modules 
(important if you can't modify your local perl installation, for 
whatever reason). Aside: I also like POSIX::tmpnam() vs some 
unholy amalgam of $$ and time() if only because I can blame a 
standards committee (or Sun) if my code blows up...

Date::Manip is a weighty sledgehammer but very nice if you're not 
converting, say, a million timestamps from webserver logs :)

TMTOWTDI,

-- Bob

On 25 Sep 00, at 3:10, ivan wrote:

> perl -MCPAN -e 'install Date::Format'
> man Date::Format
> 
> On Mon, Sep 25, 2000 at 03:20:42PM +0530, SandeepPeriwal wrote:
> > 
> > Hi,
> > I am using RT on RH Linux 6.2.
> > The date stored in the RT database is in UNIX format...like
> > 968498838. I need to convert this in normal dd/mm/yyyy format. Can
> > somebody please suggest how to get around with this. Thanks in
> > advance. reg sandeep
> >  
> > 
> > _______________________________________________
> > Rt-devel mailing list
> > Rt-devel at lists.fsck.com
> > http://lists.fsck.com/mailman/listinfo/rt-devel
> 
> -- 
> meow
> _ivan
> 
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
> 






More information about the Rt-devel mailing list