X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=9e3b67ef1b603b286379706f4f1510b39c6d771c;hb=b5d22578f60ba105934c92c031799671bf6c0f29;hp=e1874259ed957ccef7e1b59a346a203aec9eaf4e;hpb=65d0561c4d456c2d600acb03a675549d098f5776;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e1874259e..9e3b67ef1 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -5,7 +5,8 @@ use strict; use vars qw( %plans $DEBUG $setup_hack $skip_pkg_svc_hack ); use Carp qw(carp cluck confess); use Scalar::Util qw( blessed ); -use Time::Local qw( timelocal timelocal_nocheck ); +use DateTime; +use Time::Local qw( timelocal timelocal_nocheck ); # eventually replace with DateTime use Tie::IxHash; use FS::Conf; use FS::Record qw( qsearch qsearchs dbh dbdef ); @@ -1094,10 +1095,11 @@ sub delay_start_date { my $self = shift; my $delay = $self->delay_start or return ''; - - my ($mday,$mon,$year) = (localtime(time))[3,4,5]; - timelocal(0,0,0,$mday,$mon,$year) + 86400 * $delay; + # avoid timelocal silliness + my $dt = DateTime->today(time_zone => 'local'); + $dt->add(days => $delay); + $dt->epoch; } sub can_currency_exchange { 0; }