From: Dylan William Hardison Date: Tue, 30 Sep 2014 22:01:38 +0000 (-0400) Subject: Bug 1070317 - Bugzilla::Flag's attribute modification_date is affected by the user... X-Git-Tag: bugzilla-4.4.6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa1698c5b759eb166136a493eb85de49f77f909a;p=thirdparty%2Fbugzilla.git Bug 1070317 - Bugzilla::Flag's attribute modification_date is affected by the user's timezone and differs from the database copy after a call to $flag->update() r=dkl, a=justdave --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 3cba94c883..ac06a255c5 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -455,14 +455,15 @@ sub create { sub update { my $self = shift; my $dbh = Bugzilla->dbh; - my $timestamp = shift || $dbh->selectrow_array('SELECT NOW()'); + my $timestamp = shift || $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); my $changes = $self->SUPER::update(@_); if (scalar(keys %$changes)) { $dbh->do('UPDATE flags SET modification_date = ? WHERE id = ?', undef, ($timestamp, $self->id)); - $self->{'modification_date'} = format_time($timestamp, '%Y.%m.%d %T'); + $self->{'modification_date'} = + format_time($timestamp, '%Y.%m.%d %T', Bugzilla->local_timezone); } return $changes; }