Hi Adym -
  
At 2005-10-13, 09:18:13 you 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`);

This will only work if your system has the GNU/'nix 'date' command installed.
Try this script using perl's intermal 'localtime' command:

use strict;
use warnings;

my( $sec, $min, $hr, $day, $mon, $yr ) = localtime();
my $myDate = sprintf "%04d%02d%02d-%02d%02d%02d",
    $yr + 1900, $mon + 1, $day, $hr, $min, $sec;
print "$myDate\n";

>
>
>tia,
>
>Adym Lincoln
                        
Aloha => Beau;
[EMAIL PROTECTED]
2005-10-13


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

Reply via email to