, December 21, 2001 16:27
To: [EMAIL PROTECTED]
Subject: RE: executing system call
> I believe you would be better off (again matter of
> opinion) using timelocal like
>
> [SNIP]
Aww... timelocal isn't in the Perl5 Pocket Reference -
which Larry Wall says is perfect. I did manage
--- Scott Lutz <[EMAIL PROTECTED]> wrote:
> I am trying to get the date to create a file named after the current
> date.
> ( running under win32 )
>
> here is the code :
> my $datestamp=`date`;
> print "File name created : $datestamp\n";
'date', on a Windows box, allows you to display or set t
> I believe you would be better off (again matter of
> opinion) using timelocal like
>
> [SNIP]
Aww... timelocal isn't in the Perl5 Pocket Reference -
which Larry Wall says is perfect. I did manage to find
localtime, maybe that might do instead. :)
Compare the documentation for timelocal and
> I am trying to get the date to create a file named
> after the current date.
> ( running under win32 )
>
> here is the code :
> my $datestamp=`date`;
> print "File name created : $datestamp\n";
Don't do that! The Win32 date command is interactive - it
expects you to change the date. Beside
I believe you would be better off (again matter of opinion) using timelocal
like
my ($mysec, $mymin, $myhour, $myday, $mymon, $myyear) = timelocal(time);
my $datestamp = sprintf "%04d%02d%02d", (1900+$myyear), $mymon+1, $myday;
This would give for 21 dec 2001 the