cpiety has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Time::Local; use Date::Manip qw(ParseDate UnixDate); while (<IN>) { $date = ParseDate($_); if (!$date) { warn "Bad date string: $_\n"; next; } else { ($year, $month, $day, $hour, $min ) = UnixDate($date, "%Y", "% +m", "%d", "%H", "%M"); print "Date was $month/$day/$year/$hour/$min\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: changing a string to a useable date time
by Limbic~Region (Chancellor) on Feb 01, 2005 at 15:16 UTC | |
by cpiety (Novice) on Feb 01, 2005 at 16:28 UTC | |
by Limbic~Region (Chancellor) on Feb 01, 2005 at 16:31 UTC | |
by cpiety (Novice) on Feb 01, 2005 at 16:49 UTC | |
|
Re: changing a string to a useable date time
by demerphq (Chancellor) on Feb 01, 2005 at 15:34 UTC | |
|
Re: changing a string to a useable date time
by friedo (Prior) on Feb 01, 2005 at 15:03 UTC | |
by cpiety (Novice) on Feb 01, 2005 at 15:14 UTC |