summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Misc/DateTime.pm5
-rw-r--r--httemplate/elements/table-tickets.html2
2 files changed, 4 insertions, 3 deletions
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);
}
}
diff --git a/httemplate/elements/table-tickets.html b/httemplate/elements/table-tickets.html
index ffcaf0677..f89f98422 100644
--- a/httemplate/elements/table-tickets.html
+++ b/httemplate/elements/table-tickets.html
@@ -153,7 +153,7 @@ if ( $ss_priority ) {
my $format = $conf->config('date_format') || '%Y-%m-%d';
my $date_formatter = sub {
- my $time = str2time($_[0], 'GMT');
+ my $time = parse_datetime($_[0], 'GMT');
# exclude times within 24 hours of zero
($time > 86400) ? time2str($format, $time) : '';
};