Defect #3734

fetch_changesets save local time instead of GMT in the database.

Added by Aleksej Lebedev over 12 years ago. Updated almost 9 years ago.

Status:Needs feedbackStart date:2009-08-13
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
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
                             })

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


Related issues

Related to Redmine - Patch #1705: Use Rails timezones support New 2008-07-29

History

#1 Updated by Daniel Felix almost 9 years ago

  • Status changed from New to Needs feedback

Any news on this?

Can someone confirm this defect in the current trunk?

Also available in: Atom PDF