#!/usr/bin/perl
#NAME
#  ut - display local time
#
#SYNOPSIS
#  ut [timestamp]..
#
#DESCRIPTION
#  This takes one or more Unix timestamps, or the value of time(), 
#  and outputs it plus the local time in OSI format.
#
#SEE ALSO
#  ts, lt
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>

push(@ARGV, time) if !@ARGV;
@day = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat','Sun');
while ($t = shift) {
	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($t);
	printf "$t\t%s %04d-%02d-%02d %02d:%02d:%02d\n",$day[$wday],1900+$year,1+$mon,$mday,$hour,$min,$sec;
}
