Gossamer Forum
Home : General : Perl Programming :

date question

Quote Reply
date question
hey a bit of a newbie question,
i want to add a date to my webpage. i can do using the code below but i would like it in a different format.
i would like Thu, 05 Jun 2003 20:00:26 GMT to come up as Thursday, 05 June 2003. i know i can do this using loads and loads of if statements...i'm just wondering if there is a simple way to do it.

Code:
$timestring = time2str($time);
or
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());


thanks
Pedge
Quote Reply
Re: [pedge] date question In reply to
Code:
use POSIX qw/strftime/;

my $date = POSIX::strftime("%A, %d %B %Y", localtime);

Last edited by:

Paul: Jun 5, 2003, 2:36 PM
Quote Reply
Re: [Paul] date question In reply to
done.

thanks