in reply to SOLVED: DateTime question

It's related to MySQL's timestamp's time zone being unknown ('floating').

use strict; use warnings; use DateTime qw( ); use DateTime::Format::MySQL qw( ); my $now = DateTime->new( year => 2009, month => 10, day => 5, hour => 14, minute => 48, second => 9, time_zone => 'America/New_York', ); my $then = DateTime::Format::MySQL->parse_datetime( '2009-10-06 18:00:00', ); for (1..2) { my $diff = $then->delta_ms($now); print( $diff->in_units('minutes'), "\n" ); $then->set_time_zone('America/New_York'); }
191 1631

I don't know why it doesn't give an error.

Replies are listed 'Best First'.
Re^2: DateTime question
by antigua (Novice) on Oct 05, 2009 at 19:33 UTC

    Thanks, thanks. My headache went away a little bit. :)