Skip to content

Commit

Permalink
Merge pull request #11508: jewel: utime.h: fix timezone issue in roun…
Browse files Browse the repository at this point in the history
…d_to_* funcs.

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Oct 17, 2016
2 parents 20a0657 + aaa6087 commit 11e7f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/utime.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class utime_t {
utime_t round_to_minute() {
struct tm bdt;
time_t tt = sec();
gmtime_r(&tt, &bdt);
localtime_r(&tt, &bdt);
bdt.tm_sec = 0;
tt = mktime(&bdt);
return utime_t(tt, 0);
Expand All @@ -157,7 +157,7 @@ class utime_t {
utime_t round_to_hour() {
struct tm bdt;
time_t tt = sec();
gmtime_r(&tt, &bdt);
localtime_r(&tt, &bdt);
bdt.tm_sec = 0;
bdt.tm_min = 0;
tt = mktime(&bdt);
Expand Down

0 comments on commit 11e7f62

Please sign in to comment.