Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Output:#!/usr/bin/env perl use strict; use warnings; use Time::Piece::Plus; my $today = Time::Piece::Plus->today; my $date = Time::Piece::Plus->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";
Date: Mon Apr 20 00:00:00 2015 tzoffset=0 Today: Mon Apr 20 00:00:00 2015 tzoffset=-25200 Diff: -25200
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ignoring timezones when comparing dates with Time::Piece
by choroba (Cardinal) on Apr 20, 2015 at 23:20 UTC | |
|
Re: Ignoring timezones when comparing dates with Time::Piece::Plus
by Anonymous Monk on Apr 20, 2015 at 23:24 UTC | |
by Anonymous Monk on Apr 21, 2015 at 01:47 UTC |