Lincoln, Adym wrote:
Hi all,

I know this has been asked, but I couldn't find anything on the web or
in ActiveState's search of the mailing list.  How do you obtain a
timestamp/date in the form of YYYYMMDD-HHMISS from ActivePerl's date()
function on Windoze?  The following code doesn't want to work :

chop(my $myDate = `date +%Y%m%d-%H%M%S`);


I'm using linux like function time and my user function

sub get_time
{
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$mon++; $year+=1900;
return sprintf("%04d.%02d.%02d-%02d:%02d:%02d", $year,$mon,$mday,$hour,$min,$sec);
}


Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.)


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to