Hello kepler,
You have already 83 Writeups on this forum so I think you know what is a Short, Self Contained, Correct (Compilable), Example that fellow monk stevieb is asking you for.
Just to clarify in case that still is not clear why we all monks asking for that. If you need our assistance, you have to show the minimum effort and create a small script executable that replicates your problem. By doing this you can help us to help you.
Moving on, are you looking for something like this?
#!usr/bin/perl use say; use strict; use warnings; use DateTime; use DateTime::TimeZone; sub TimeZone { my ($dt) = @_; my $tz = $dt->time_zone(); my $offset = $tz->offset_for_datetime($dt); return $offset; } my $dt = DateTime->new( year => 1964, month => 10, day => 16, hour => 16, minute => 12, second => 47, nanosecond => 500000000, time_zone => 'Asia/Taipei', ); my $tz = DateTime::TimeZone->new( name => 'America/Chicago' ); my $offset = $tz->offset_for_datetime($dt); say TimeZone($dt); say $offset; __END__ $ perl test.pl 28800 -18000
I used the default parameters as give in DateTime.
Hope this helps, BR.
In reply to Re: Date Timezone
by thanos1983
in thread Date Timezone
by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |