On Thu, 21 Jun 2001 [EMAIL PROTECTED] wrote:
..
> 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";

This is a Bad Solution(tm)!!!

Why reinvent the wheel when POSIX::strftime() can do all that and more?

More importantly, your method is not LOCALIZED, whereas
POSIX::strftime() with a properly localized libc (such as that in Sun
Solaris) can output human-grokkable dates in MANY LANGUAGES.  =)

Just choose your locale!!


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

Reply via email to