tanger has asked for the wisdom of the Perl Monks concerning the following question:
The code is not fully finished because im stuck.($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time ++$addsecs); @months = ("1","2","3","4","5","6","7","8","9","10","11","12"); @days = ("Sun","Mon","Tue","Wed","Thur","Fri","Sat"); if ($sec < 10) {$sec = "0$sec";} if ($min < 10) {$min = "0$min";} if ($hour < 10) {$hour = "$hour";} if ($hour > 11) {$ap = "PM";} if ($hour < 12) {$ap = "AM";} if ($mday < 10) {$mday = "0$mday";} if ($hour eq 00) { $hour = "12"; } if ($hour > 12) { $hour = ($hour - 12); $ap = "p.m."; } $millyear = $year + 1900; $date = "@days[$wday]:$mday:@months[$mon]:$millyear"; $time = "$hour:$min:$sec:$ap:$date"; use DB_File; # optional; overrides default tie %who, "DB_File", "$path/whosonline" or die "Can't open FILENAME: $ +!\n"; # open database tie hash to db $who{$Account::account} = "$time"; #account-value time-key @person = keys(%who); foreach $timer (values %who) { ($hr, $mins, $secs, $appm, $day, $daynumber, $month, $year) = split(/: +/, $timer); print <<EOF; $hr, $mins, $secs, $appm, $day, $daynumber, $month, $year EOF if ($hour eq $hr) { if (@days[$wday] eq $day) { $member = $who; print <<EOF; $member EOF
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with time stamp
by extremely (Priest) on Feb 21, 2001 at 12:18 UTC | |
|
Re: help with time stamp
by dws (Chancellor) on Feb 21, 2001 at 11:49 UTC | |
|
Re: help with time stamp
by a (Friar) on Feb 21, 2001 at 11:35 UTC |