Project

General

Profile

Actions

Defect #3734

open

fetch_changesets save local time instead of GMT in the database.

Added by Aleksej Lebedev over 14 years ago. Updated about 11 years ago.

Status:
Needs feedback
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2009-08-13
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

At saving commits in a database, time of each of them will be converted in the local time and in this form will be retained in the database. When you browse the repository the commits time will be displayed incorrectly, because will be re-converted in the local time...

Patch to correct this:

Index: lib/redmine/scm/adapters/subversion_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/subversion_adapter.rb    (revision 2838)
+++ lib/redmine/scm/adapters/subversion_adapter.rb    (working copy)
@@ -58,7 +58,7 @@
               info = Info.new({:root_url => doc.elements["info/entry/repository/root"].text,
                                :lastrev => Revision.new({
                                  :identifier => doc.elements["info/entry/commit"].attributes['revision'],
-                                 :time => Time.parse(doc.elements["info/entry/commit/date"].text).localtime,
+                                 :time => Time.parse(doc.elements["info/entry/commit/date"].text),
                                  :author => (doc.elements["info/entry/commit/author"] ? doc.elements["info/entry/commit/author"].text : "")
                                })
                              })
@@ -96,7 +96,7 @@
                             :size => ((s = entry.elements['size']) ? s.text.to_i : nil),
                             :lastrev => Revision.new({
                               :identifier => commit.attributes['revision'],
-                              :time => Time.parse(commit_date.text).localtime,
+                              :time => Time.parse(commit_date.text),
                               :author => ((a = commit.elements['author']) ? a.text : nil)
                               })
                             })
@@ -159,7 +159,7 @@

                 revisions << Revision.new({:identifier => logentry.attributes['revision'],
                               :author => (logentry.elements['author'] ? logentry.elements['author'].text : ""),
-                              :time => Time.parse(logentry.elements['date'].text).localtime,
+                              :time => Time.parse(logentry.elements['date'].text),
                               :message => logentry.elements['msg'].text,
                               :paths => paths
                             })


Files

info.txt (1.35 KB) info.txt Aleksej Lebedev, 2009-08-13 22:55

Related issues

Related to Redmine - Patch #1705: Use Rails timezones supportNew2008-07-29

Actions
Actions #1

Updated by Daniel Felix about 11 years ago

  • Status changed from New to Needs feedback

Any news on this?

Can someone confirm this defect in the current trunk?

Actions

Also available in: Atom PDF