(first): Use std::localtime instead of std::gmtime. (increment): Use
std::localtime instead of std::gmtime.
This commit is contained in:
parent
577767ea58
commit
ce7da4cec1
1 changed files with 3 additions and 4 deletions
|
|
@ -45,7 +45,7 @@ std::time_t interval_t::first(const std::time_t moment) const
|
||||||
// late enough that we don't spend hundreds of thousands of loops
|
// late enough that we don't spend hundreds of thousands of loops
|
||||||
// skipping through time.
|
// skipping through time.
|
||||||
|
|
||||||
struct std::tm * desc = std::gmtime(&moment);
|
struct std::tm * desc = std::localtime(&moment);
|
||||||
if (years)
|
if (years)
|
||||||
desc->tm_mon = 0;
|
desc->tm_mon = 0;
|
||||||
desc->tm_mday = 1;
|
desc->tm_mday = 1;
|
||||||
|
|
@ -70,7 +70,7 @@ std::time_t interval_t::increment(const std::time_t moment) const
|
||||||
std::time_t then = moment;
|
std::time_t then = moment;
|
||||||
|
|
||||||
if (years || months) {
|
if (years || months) {
|
||||||
struct std::tm * desc = std::gmtime(&then);
|
struct std::tm * desc = std::localtime(&then);
|
||||||
|
|
||||||
if (years)
|
if (years)
|
||||||
desc->tm_year += years;
|
desc->tm_year += years;
|
||||||
|
|
@ -138,8 +138,7 @@ static void parse_inclusion_specifier(const std::string& word,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void read_lower_word(std::istream& in, std::string& word) {
|
||||||
void read_lower_word(std::istream& in, std::string& word) {
|
|
||||||
in >> word;
|
in >> word;
|
||||||
for (int i = 0, l = word.length(); i < l; i++)
|
for (int i = 0, l = word.length(); i < l; i++)
|
||||||
word[i] = std::tolower(word[i]);
|
word[i] = std::tolower(word[i]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue