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 Nov 9, 2016
2 parents 0bfc25c + 4f8287f commit aafe9df
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 aafe9df

Please sign in to comment.