#This function returns the number of seconds since the epoch (00:00:00 UTC, January 1, 1970, for most systems; 00:00:00, January 1, 1904, for Mac OS). Suitable for feeding to gmtime and localtime. $retval = time(); print "Return time is $retval seconds since Jan 1, 1970\n\n"; ################################################################## $gmt_time = gmtime( $retval); #GMT Time print "GMT time = $gmt_time\n"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); $year = $year + 1900; $mon += 1; print "Formated GMT time = $mday/$mon/$year $hour:$min:$sec $weekday[$wday]\n\n"; ############################################################################## $local_time = localtime( $retval); #GMT Time print "Local time = $local_time\n"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = $year + 1900; $mon += 1; print "Formated local time = $mday/$mon/$year $hour:$min:$sec $weekday[$wday]\n\n";