Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    ...
    my $time = time;
    my $timestr = localtime($time);
    print "Current date/time is $timestr\n";
    
  2. or download this
    my $x = `time /t`;  # Assign $x to the system time (only in Windows)
    chomp $x;           # $x now holds something like "10:51 AM"