LighthouseJ has asked for the wisdom of the Perl Monks concerning the following question:
(Note: the months correspond to September and October respectively.)Sun 09 30 06 42 36 2007 Tue 10 02 06 01 55 2007
my @array; while (<>) { chomp; my @fields = split; shift @fields; unshift(@fields, pop(@fields)); $fields[1]--; # decrement the month, timelocal is zero-based push (@array, timelocal (reverse @fields)); } print $array[1] - $array[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Diff'ing dates
by ikegami (Patriarch) on Oct 02, 2007 at 13:33 UTC | |
by LighthouseJ (Sexton) on Oct 02, 2007 at 14:33 UTC | |
by ikegami (Patriarch) on Oct 02, 2007 at 14:50 UTC | |
by LighthouseJ (Sexton) on Oct 02, 2007 at 15:30 UTC | |
by LighthouseJ (Sexton) on Oct 02, 2007 at 14:19 UTC | |
by shmem (Chancellor) on Oct 02, 2007 at 14:47 UTC | |
by ikegami (Patriarch) on Oct 02, 2007 at 14:43 UTC | |
by LighthouseJ (Sexton) on Oct 02, 2007 at 15:23 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |