From f79830925a4820019c7fe25af702059af0e54125 Mon Sep 17 00:00:00 2001 From: jpaint Date: Sun, 23 Apr 2000 22:50:51 +0000 Subject: [PATCH] work around more time bugs in MySQLdb git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@76 8cb11bc2-c004-0410-86c3-e597b4017df7 --- lib/database.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/database.py b/lib/database.py index 98575fe9..6b93427d 100644 --- a/lib/database.py +++ b/lib/database.py @@ -251,7 +251,14 @@ class CheckinDatabase: def AddCommit(self, commit): dbType = commit.GetTypeString() - dbCI_When = DBI.TimestampFromTicks(commit.GetTime()) + + ## MORE TIME HELL: the MySQLdb module doesn't construct times + ## correctly when created with TimestampFromTicks -- it doesn't + ## account for daylight savings time, so we use Python's time + ## module to do the conversion + temp = time.localtime(commit.GetTime()) + dbCI_When = DBI.Timestamp(temp) + dbWhoID = self.GetAuthorID(commit.GetAuthor()) dbRepositoryID = self.GetRepositoryID(commit.GetRepository()) dbDirectoryID = self.GetDirectoryID(commit.GetDirectory())