in reply to Re: Date Timezone
in thread Date Timezone
Here's what I'm trying:
As I've said, no error. It just...stops. If I don't call it the entire scripts works.#!/usr/bin/perl use LWP::Simple; use DateTime; use DateTime::TimeZone; etc etc... sub TimeZone () { (my $year_tz, my $month_init, my $hour_init, my $zone) = @_; $offset_days = 0; $offset = 0; my $minutes_init = 0; my $seconds_init = 0; my $tz = DateTime::TimeZone->new( name => $zone ); my $dt = DateTime->new( year => $year_tz, month => $month_init, day => $day_init, hour => $hour_init, minute => $minutes_init, second => $seconds_init, nanosecond => 0, ); $offset = $tz->offset_for_datetime($dt); $offset_days = $offset / 86400; return $offset_days; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Date Timezone
by huck (Prior) on Jul 15, 2017 at 23:44 UTC | |
|
Re^3: Date Timezone
by 1nickt (Canon) on Jul 16, 2017 at 02:55 UTC | |
|
Re^3: Date Timezone
by stevieb (Canon) on Jul 16, 2017 at 01:19 UTC | |
by kepler (Scribe) on Jul 16, 2017 at 01:29 UTC |