From 35df2cd5bc44b1f369ca6d32dfe1c600c1608dc4 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Sat, 14 May 2016 14:09:38 +0000 Subject: Bug 232193 - bmo's systems (webheads, database, etc) should use UTC natively for o/s timezone and date storage --- extensions/BMO/lib/Reports/ReleaseTracking.pm | 4 ++-- extensions/BMO/lib/Reports/UserActivity.pm | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'extensions/BMO/lib') diff --git a/extensions/BMO/lib/Reports/ReleaseTracking.pm b/extensions/BMO/lib/Reports/ReleaseTracking.pm index 0d9a51583..8894a5169 100644 --- a/extensions/BMO/lib/Reports/ReleaseTracking.pm +++ b/extensions/BMO/lib/Reports/ReleaseTracking.pm @@ -367,9 +367,9 @@ sub report { push @where, "(a.fieldid = ?)"; push @params, $q->{field_id}; - push @where, "(a.bug_when >= ?)"; + push @where, "(CONVERT_TZ(a.bug_when, 'UTC', 'America/Los_Angeles') >= ?)"; push @params, $q->{start_date} . ' 00:00:00'; - push @where, "(a.bug_when <= ?)"; + push @where, "(CONVERT_TZ(a.bug_when, 'UTC', 'America/Los_Angeles') <= ?)"; push @params, $q->{end_date} . ' 23:59:59'; push @where, "(a.added LIKE ?)"; diff --git a/extensions/BMO/lib/Reports/UserActivity.pm b/extensions/BMO/lib/Reports/UserActivity.pm index 04810c2ec..0a8e79e1f 100644 --- a/extensions/BMO/lib/Reports/UserActivity.pm +++ b/extensions/BMO/lib/Reports/UserActivity.pm @@ -126,7 +126,8 @@ sub report { INNER JOIN profiles ON profiles.userid = bugs_activity.who WHERE profiles.login_name IN ($who_bits) - AND bugs_activity.bug_when >= ? AND bugs_activity.bug_when <= ? + AND CONVERT_TZ(bugs_activity.bug_when, 'UTC', 'America/Los_Angeles') >= ? + AND CONVERT_TZ(bugs_activity.bug_when, 'UTC', 'America/Los_Angeles') <= ? $activity_where UNION ALL @@ -147,8 +148,8 @@ sub report { INNER JOIN profiles ON profiles.userid = longdescs_tags_activity.who WHERE profiles.login_name IN ($who_bits) - AND longdescs_tags_activity.bug_when >= ? - AND longdescs_tags_activity.bug_when <= ? + AND CONVERT_TZ(longdescs_tags_activity.bug_when, 'UTC', 'America/Los_Angeles') >= ? + AND CONVERT_TZ(longdescs_tags_activity.bug_when, 'UTC', 'America/Los_Angeles') <= ? $tags_activity_where UNION ALL @@ -167,7 +168,8 @@ sub report { INNER JOIN profiles ON profiles.userid = bugs.reporter WHERE profiles.login_name IN ($who_bits) - AND bugs.creation_ts >= ? AND bugs.creation_ts <= ? + AND CONVERT_TZ(bugs.creation_ts, 'UTC', 'America/Los_Angeles') >= ? + AND CONVERT_TZ(bugs.creation_ts, 'UTC', 'America/Los_Angeles') <= ? UNION ALL @@ -185,7 +187,8 @@ sub report { INNER JOIN profiles ON profiles.userid = longdescs.who WHERE profiles.login_name IN ($who_bits) - AND longdescs.bug_when >= ? AND longdescs.bug_when <= ? + AND CONVERT_TZ(longdescs.bug_when, 'UTC', 'America/Los_Angeles') >= ? + AND CONVERT_TZ(longdescs.bug_when, 'UTC', 'America/Los_Angeles') <= ? $comment_filter UNION ALL @@ -204,7 +207,8 @@ sub report { INNER JOIN profiles ON profiles.userid = attachments.submitter_id WHERE profiles.login_name IN ($who_bits) - AND attachments.creation_ts >= ? AND attachments.creation_ts <= ? + AND CONVERT_TZ(attachments.creation_ts, 'UTC', 'America/Los_Angeles') >= ? + AND CONVERT_TZ(attachments.creation_ts, 'UTC', 'America/Los_Angeles') <= ? $attachments_where ORDER BY $order "; -- cgit v1.2.3-24-g4f1b