Skip to content

Commit

Permalink
Modern Date::Manip has deprecated ConvTZ, in favor of a more expressi…
Browse files Browse the repository at this point in the history
…ve ForceDate
  • Loading branch information
alexmv committed Apr 30, 2015
1 parent 35bb263 commit 6422ab8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/Jifty/DateTime.pm
Expand Up @@ -299,16 +299,11 @@ sub new_from_string {
$args{time_zone} ? (time_zone => $args{time_zone}) : (),
);

my $dt_now = $class->now;
my $now = $dt_now->ymd . '-' . $dt_now->hms;

require Date::Manip;

# TZ sets the timezone for parsing
# ConvTZ sets the output timezone
# ForceDate forces the current date to be now in the user's timezone,
# if we don't set it then DM uses the machine's timezone
Date::Manip::Date_Init("TZ=$offset", "ConvTZ=+0000", "ForceDate=$now");
Date::Manip::Date_Init("ForceDate=now,$offset");
$epoch = Date::Manip::UnixDate( $string, "%o" );
}

Expand Down

0 comments on commit 6422ab8

Please sign in to comment.