Chris Nikou wrote:

> how can i retrieve current time & date in order to store them into 2 
> variables ($date,$time)
> 
> and then store them into a file?


Change the format to what you want:


use strict;
use POSIX;

my $date = strftime ("%d-%b-%Y", localtime);    # 06-Feb-2002
my $time = strftime ("%H:%M:%S", localtime);    # 14:22:00

open OUT, '>filename' or die "Error opening 'filename': $!\n";
print OUT $date, "\n";
print OUT $time, "\n";
close OUT;

__END__


-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to