(increment): When calculating time interval increments, set tm_isdst
to zero to avoid gaining or losing a day because of daylight savings time.
This commit is contained in:
parent
a787adb127
commit
fec8fbf6be
1 changed files with 4 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue