Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Comparing DateTime objects in different timezones

by hippo (Bishop)
on Oct 31, 2017 at 23:05 UTC ( #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? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2022-08-11 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?