Try this.

$thisday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime)[6]];
$thisdate = (localtime)[3];

if ($thisdate == 1 || $thisdate == 21 || $thisdate == 31) {
        $thisdate .= "st";
} elsif ($thisdate == 2 || $thisdate == 22) {
        $thisdate .= "nd";
} elsif ($thisdate == 3 || $thisdate == 23) {
        $thisdate .= "rd";
} else {
        $thisdate .= "th";
}

$thismonth =
(Janurary,Feburary,March,April,May,June,July,August,September,October,Novemb
er,December)[(localtime)[4]];
$thisyear = (localtime)[5] + 1900;

print "$thisday $thisdate $thismonth $thisyear";

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 05 December 2001 16:29
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: today's date....


There are a number of date formatting routines available at
http://search.cpan.org/.

> -----Original Message-----
> From: Shinagare, Sandeep [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 11:27 AM
> To: '[EMAIL PROTECTED]'
> Subject: today's date....
> 
> 
> Hi Folks!
> Trying to get todays date and month... was able to find this...
> 
> #snip-start
>   use Time::localtime;
>   $tm = localtime;
>   ($DAY, $MONTH, $YEAR) = ($tm->mday, $tm->mon, $tm->year);
> #snip-end
> 
> this gives me the Day and Month in numbers.. anyway in which i 
> can get "Mon","Tue","Wed" and "Jan","Feb","Mar" etc.. other than 
> coding the conversion?
> 
> Thanks, 
> Sandeep
> 
> 
> **********************************************************************
> COLT Telecommunications
> Registered in England No. 2452736
> Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
> Tel. 020 7390 3900
> 
> This message is subject to and does not create or vary any contractual
> relationship between COLT Telecommunications, its subsidiaries or 
> affiliates ("COLT") and you. Internet communications are not secure
> and therefore COLT does not accept legal responsibility for the
> contents of this message.  Any view or opinions expressed are those of
> the author. The message is intended for the addressee only and its
> contents and any attached files are strictly confidential. If you have
> received it in error, please telephone the number above. Thank you.
> 
> 
> **************************************************************
> **********
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
This message may contain information which is private, privileged or
confidential and is intended solely for the use of the individual or entity
named in the message. If you are not the intended recipient of this message,
please notify the sender thereof and destroy / delete the message. Neither
the sender nor Sappi Limited (including its subsidiaries and associated
companies) shall incur any liability resulting directly or indirectly from
accessing any of the attached files which may contain a virus or the like. 

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


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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

Reply via email to