rvosa has asked for the wisdom of the Perl Monks concerning the following question:
Is there a shortcut to turn these into a value as returned by time(), i.e. number of seconds since the epoch? So that I can do numerical comparisons on the dates, and then format them back into something pretty using localtime() or the POSIX strftime function?if( $time =~ m/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z?)$/ ) { ( $year, $month, $day, $hour, $min, $sec, $is_gmt ) = ( $1, $2, $3, $4, $5, $6, $7 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The opposite of localtime()
by brian_d_foy (Abbot) on Mar 31, 2006 at 05:36 UTC | |
by rvosa (Curate) on Mar 31, 2006 at 07:02 UTC | |
|
Re: The opposite of localtime()
by xdg (Monsignor) on Mar 31, 2006 at 05:35 UTC | |
|
Re: The opposite of localtime()
by gube (Parson) on Mar 31, 2006 at 06:20 UTC |