Thanks Orly. I made a dirty script:
#!/usr/local/bin/perl
#
$now = time();
($seconds,$minutes,$hour,$monthday,$month,
$year,$weekday,$yearday,$dst_flag) = localtime( $now );
$year = $year + 1900;
$month_name = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$month];
print "$month_name $monthday $year\n";
-----Original Message-----
From: Orlando Andico [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 1:29 PM
To: [EMAIL PROTECTED]
Subject: Re: [plug] [OT] Converting epoch seconds to readable format
On Thu, 21 Jun 2001, neuroticimbecile wrote:
..
> On Thu, 21 Jun 2001, you wrote:
> > Hi all,
> >
> > I'm looking for a way to convert epoch seconds into a readable format
like
> > "Jun 12 2000" or "Feb 01 2001" using Perl :)
>
> try localtime(),
>
> print(localtime(time()))
when localtime() returns a scalar, you can't control how the output
"looks" hence
print POSIX::strftime("%blah", localtime($my_time))
is more flexible.
Update 'to hah, Mr FrancisV.. na-typo ko yung earlier mail ko. It's
strftime not sprintf =)
--
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GE d(-) s: a-25 C++++ UBLSI++++$ P+++ L+++>++++ E- W++ N(+)
o K? w O-- M- !V PS(++) PE- Y PGP-- t(+)@ 5(+) X++@ R(+) tv@
b++ DI++ G e++@ h--(*) r% y+
------END GEEK CODE BLOCK------
_
Philippine Linux Users Group. Web site and archives at
http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]