Project

General

Profile

Actions

Defect #10996

closed

Time zones lost when upgrading from Redmine 1.4 to 2.0

Added by Jack Christensen over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

It seems that previous versions of Redmine stored times in database in local time. In 2.0 it stores it in UTC. This causes all old times to be offset by the time zone. e.g. A task I entered right before the upgrade showed as being 5 hours old.

I just ran SQL to update the time stamps appropriately, but it might be nice to have this done automatically.

Here's the script I used (PostgreSQL):

select 'UPDATE ' || table_name || ' SET ' || column_name || ' = ' || column_name || '::timestamptz at time zone ''utc'' WHERE ' || column_name || ' < ''2012-05-22 10:40:00'';'
from information_schema.columns
where table_schema='public'
  and data_type like 'timestamp without time zone'

The hard-coded time is the time that the upgrade occurred so as not to update times from after the upgrade.


Related issues

Related to Redmine - Defect #14658: Wrong activity timezone on user pageClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF