Help for this page

Select Code to Download


  1. or download this
    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, isdst) = loca
    +ltime(time);
    my $ampm=$hour>11 ? 'PM' : 'AM'; # day or night
    $hour%=12;                       # put it in the range 0..11
    $hour=12 unless $hour;           # convert 0 to 12
    print "$hour$ampm";              # print it out
    
  2. or download this
    my $hour_secs = 60*60;
    my @timeparts = localtime(time()+$hour_secs);