Probably not the prettiest, but it should work...
my ($sec,$min,$hour,$mday,$mon,$year) = (localtime(time))[0..5];
my $date =
sprintf("%04d",$year+1900) .
sprintf("%02d",$mon+1) .
sprintf("%02d",$mday) .
sprintf("%02d",$hour) .
sprintf("%02d",$min) .
sprintf("%02d",$sec)
;
------------------------------------------------
On Mon, 6 Jan 2003 14:58:10 -0000 , John Dunn <[EMAIL PROTECTED]> wrote:
> I need to return the current date and time in the following format
>
> YYYYMMDDHHMMSS
>
> but am struggling to do this using the localtime function
>
> In perticular, how do I get the month number(e.g. 09 for Sep)?
>
> John Dunn
> Sefas Innovation Ltd
> 0117 9154267
> www.sefas.com
>
>
> --
> 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]