in reply to Re: Calculating between times
in thread Calculating between times
Can you help me set it up so it works in this new format? it always dies on the third entry because the day is 31 when the error says it can only be 1..29.05.05.06 09.03.04 31.02.04 15.01.04 16.01.04 15.01.04 01.01.04 01.01.04 14.09.04 01.01.04 01.01.04 01.01.04 04.05.06 Day: 05 Month: 05 Year: 06 Day: 09 Month: 03 Year: 04 Software error: Day '31' out of range 1..29 at line 43
Thank you!
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $today = time; print "$today<br><br>"; foreach (keys %entries) { my ($date, $course, $location, $job_type, $contact) = split(/::/, $e +ntries{$_}); print "$date<br>"; } foreach (keys %entries) { my ($date, $course, $location, $job_type, $contact) = split(/::/, $e +ntries{$_}); my ($d,$m,$y) = split /\./, $date; my $saved_date = timelocal(0,0,0,$d,$m-1,$y); my $days_diff = int( ($today - $saved_date) / (24*60*60) ); print "Day: $d Month: $m Year: $y<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Calculating between times
by BUU (Prior) on Jan 09, 2004 at 06:06 UTC | |
by greenFox (Vicar) on Jan 09, 2004 at 06:33 UTC | |
by Anonymous Monk on Jan 09, 2004 at 06:43 UTC | |
by BUU (Prior) on Jan 09, 2004 at 07:55 UTC | |
by Skylark (Beadle) on Jan 09, 2004 at 14:42 UTC |