X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMisc%2FDateTime.pm;h=9c12e6408fdcafdb808331b3bc992afd37f1f5fa;hb=c1bc17318fff6d7636601ef8de7fbce3734a785a;hp=e36f3a95a90921d35d47137f59ba2e349c122c8e;hpb=0d2c8c61b8c5644c7dedcffcb28210f9a0cec55d;p=freeside.git diff --git a/FS/FS/Misc/DateTime.pm b/FS/FS/Misc/DateTime.pm index e36f3a95a..9c12e6408 100644 --- a/FS/FS/Misc/DateTime.pm +++ b/FS/FS/Misc/DateTime.pm @@ -32,13 +32,14 @@ the date as an integer UNIX timestamp. sub parse_datetime { my $string = shift; return '' unless $string =~ /\S/; + my $tz = shift || 'local'; my $conf = new FS::Conf; my $format = $conf->config('date_format') || '%m/%d/%Y'; if ( $format eq '%d/%m/%Y' ) { # =~ /\%d.*\%m/ ) { #$format =~ s/\%//g; - my $parser = DateTime::Format::Natural->new( 'time_zone' => 'local', + my $parser = DateTime::Format::Natural->new( 'time_zone' => $tz, #'format'=>'d/m/y',#lc($format) ); $dt = $parser->parse_datetime($string); @@ -51,7 +52,7 @@ sub parse_datetime { $dt->epoch; } } else { - return str2time($string); + return str2time($string, $tz); } }