Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Comparing DateTime objects in different timezones

by hippo (Bishop)
on Oct 31, 2017 at 23:05 UTC ( [id://1202483]=note: print w/replies, xml ) Need Help??


in reply to Comparing DateTime objects in different timezones

It's trivial using Time::Piece:

#!/usr/bin/env perl use strict; use warnings; use Time::Piece; my $fmt = '%a, %e, %b %Y %T %z'; my $sent = Time::Piece->strptime ('Wed, 01 Nov 2017 09:07:05 +1100', $ +fmt); my $recd = Time::Piece->strptime ('Tue, 31 Oct 2017 15:07:32 -0700', $ +fmt); my $duration = $recd - $sent; print "Took $duration seconds\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202483]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found