summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-02-16 20:17:52 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:23 -0400
commitfec8fbf6bed7e217f24510accfe75117d51a5a5c (patch)
treea96e24c6604a549222ee202554b68761e8aa97ea
parenta787adb1278121b8b691faca21b9dbaddc93ea92 (diff)
downloadfork-ledger-fec8fbf6bed7e217f24510accfe75117d51a5a5c.tar.gz
fork-ledger-fec8fbf6bed7e217f24510accfe75117d51a5a5c.tar.bz2
fork-ledger-fec8fbf6bed7e217f24510accfe75117d51a5a5c.zip
(increment): When calculating time interval increments, set tm_isdst
to zero to avoid gaining or losing a day because of daylight savings time.
-rw-r--r--datetime.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/datetime.cc b/datetime.cc
index e26ddf98..f3434112 100644
--- a/datetime.cc
+++ b/datetime.cc
@@ -90,9 +90,10 @@ std::time_t interval_t::increment(const std::time_t moment) const
}
}
- desc->tm_hour = 0;
- desc->tm_min = 0;
- desc->tm_sec = 0;
+ desc->tm_hour = 0;
+ desc->tm_min = 0;
+ desc->tm_sec = 0;
+ desc->tm_isdst = 0;
then = std::mktime(desc);
}