Rearrange the output as you need..

use Time::Local;

$time=&todaysdate;
print $time;

sub todaysdate
        {
        my %moname= (0,"January",
           1,"February",
           2,"March",
           3,"April",
           4,"May",
           5,"June",
           6,"July",
           7,"August",
           8,"September",
           9,"October",
           10,"November",
           11,"December"
          );
        my %wdname=(0,"Sun",
        1,"Mon",
        2,"Tue",
        3,"Wed",
        4,"Thu",
        5,"Fri",
        6,"Sat");

        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$junk,$junk) =
localtime(time());
        my $date = "$sec:$min:$hour $wdname{$wday} $moname{$mon}
".sprintf("%2d",$mday) . ", " . sprintf(
"%04d",(1900+$year)%10000);
        }

----- Original Message -----
From: "Joe Slaven" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 04, 2001 12:47 PM
Subject: Using Time::Localtime module


> Has anyone an example of using Time::Localtime module to print out the
date
> and time  to the nearest second in the format:
> :
> sec:min:hour (am/pm)  Thurs 2nd Dec 2001
>
> Thanks,
>   Joe
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to