Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl
- use strict;
- use warnings;
- use DateTime;
- use Data::Dumper;
- use DateTime::Format::Strptime;
- my $p = DateTime::Format::Strptime->new(pattern => '%F %T',
- time_zone => 'local');
- my $dt1 = DateTime->now(time_zone=>'local')->set_time_zone('UTC');
- my $dt2 = $p->parse_datetime('2010-10-22 14:12:00')->set_time_zone('UTC');
- print Dumper($dt1->hms);
- print Dumper($dt2->hms);
- print Dumper($dt1 > $dt2);
Add Comment
Please, Sign In to add comment