my $start = DateTime->new( day => 1, month => 1, year => 2009, hour => 0, minute => 0, second => 0, time_zone => 'Europe/Berlin', ); my $end = DateTime->new( day => 2, month => 1, year => 2009, hour => 0, minute => 0, second => 0, time_zone => 'Europe/Berlin', ); print $end->delta_ms($start)->in_units('hours'), "\n";