Marsel has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use DateTime; my $t1 = DateTime->new(year => 2001, month => 4, day => 23, hour => 22, minute => 32); my $t2 = DateTime->new(year => 2001, month => 4, day => 22, hour => 15, minute => 42); print "T1 = ".$t1->hour.":".$t1->minute."\n T2 = ".$t2->hour.":".$t2->minute."\n T1-T2 = ".$t1->subtract_datetime($t2)->hours."\n T2-T1 = ".$t2->subtract_datetime($t1)->hours."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DateTime usage for duration computation
by derby (Abbot) on Aug 29, 2007 at 12:25 UTC | |
|
Re: DateTime usage for duration computation
by andreas1234567 (Vicar) on Aug 29, 2007 at 13:04 UTC | |
|
Re: DateTime usage for duration computation
by girarde (Hermit) on Aug 29, 2007 at 14:09 UTC | |
by varanasi (Scribe) on Oct 20, 2014 at 01:28 UTC |