Output:#!/usr/bin/env perl use strict; use warnings; use Time::Piece::Plus; my $today = localtime()->today; my $date = localtime()->strptime("2015-04-20", '%Y-%m-%d'); print "Date: $date tzoffset=", $date->tzoffset, "\n"; print "Today: $today tzoffset=", $today->tzoffset, "\n"; print "Diff: ", ($date - $today), "\n";
Not sure what you mean by timezones mentioned all over the place.Date: Mon Apr 20 00:00:00 2015 tzoffset=-25200 Today: Mon Apr 20 00:00:00 2015 tzoffset=-25200 Diff: 0
$ cpanm Time::Piece Time::Piece is up to date. (1.29) $ cpanm Time::Piece::Plus Time::Piece::Plus is up to date. (0.05) $ perldoc -t Time::Piece | grep -i zone $t->tzoffset # timezone offset in a Time::Seconds o +bject $ perldoc -t Time::Piece::Plus | grep -i zone $
In reply to Re^2: Ignoring timezones when comparing dates with Time::Piece::Plus
by Anonymous Monk
in thread Ignoring timezones when comparing dates with Time::Piece
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |