Created
December 22, 2010 19:23
-
-
Save sinkovsky/751952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment