From 6335dbb5e1cf694afea3c306012a258614d13880 Mon Sep 17 00:00:00 2001 From: Seth Hall Date: Wed, 18 Jul 2012 11:32:14 -0400 Subject: [PATCH 1/2] Fixing calc_next_rotate to use UTC based time functions. --- src/util.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.cc b/src/util.cc index 3cfa5fca1c..abbea3e906 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1112,9 +1112,9 @@ double calc_next_rotate(double current, double interval, double base) time_t teatime = time_t(current); struct tm t; - t = *localtime_r(&teatime, &t); + t = *gmtime_r(&teatime, &t); t.tm_hour = t.tm_min = t.tm_sec = 0; - double startofday = mktime(&t); + double startofday = timegm(&t); if ( base < 0 ) // No base time given. To get nice timestamps, we round From 0a681367b70e03fbb938146ec497546aa01d4ec8 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Fri, 20 Jul 2012 06:58:39 -0700 Subject: [PATCH 2/2] Revert "Fixing calc_next_rotate to use UTC based time functions." This reverts commit 6335dbb5e1cf694afea3c306012a258614d13880. --- src/util.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.cc b/src/util.cc index abbea3e906..3cfa5fca1c 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1112,9 +1112,9 @@ double calc_next_rotate(double current, double interval, double base) time_t teatime = time_t(current); struct tm t; - t = *gmtime_r(&teatime, &t); + t = *localtime_r(&teatime, &t); t.tm_hour = t.tm_min = t.tm_sec = 0; - double startofday = timegm(&t); + double startofday = mktime(&t); if ( base < 0 ) // No base time given. To get nice timestamps, we round