nine9 has asked for the wisdom of the Perl Monks concerning the following question:

What are the variables to get the system date & time? (e.g. in 4DOS one uses %@DATE)

Replies are listed 'Best First'.
RE: Date & Time system variables
by Anonymous Monk on Dec 30, 1999 at 23:19 UTC
    localtime(); perl -le 'print scalar localtime()."\n";' Thu Dec 30 13:19:44 1999
    See also 'perldoc Time::Local' to break the current time into an array under perl5, and 'perldoc POSIX' and search for strftime() for more flexible printing.
RE: Date & Time system variables
by da w00t (Sexton) on Dec 30, 1999 at 03:36 UTC
    this should do it
    # 0 1 2 3 4 5 6 7 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
      Can also use
      # 0 1 2 3 4 5 6 7 8 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = (localtime)[0, +1,2,3,4,5,6,7,8];
      note that $mon is in the range 0..11, and $wday has the range 0..6 also, $year is returned as number of years since 1900 (currently a 2 digit number, but not a y2k problem)...