diff options
author | John Wiegley <johnw@newartisans.com> | 2005-05-27 00:38:50 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:09 -0400 |
commit | ce7da4cec18c6c0f9546756c74c158c758118989 (patch) | |
tree | c4e67619c810e25ce2d9fd6512a0c2ebbcc108a3 /datetime.cc | |
parent | 577767ea58d9781c4d90e27db32e41143f5e387e (diff) | |
download | fork-ledger-ce7da4cec18c6c0f9546756c74c158c758118989.tar.gz fork-ledger-ce7da4cec18c6c0f9546756c74c158c758118989.tar.bz2 fork-ledger-ce7da4cec18c6c0f9546756c74c158c758118989.zip |
(first): Use std::localtime instead of std::gmtime. (increment): Use
std::localtime instead of std::gmtime.
Diffstat (limited to 'datetime.cc')
-rw-r--r-- | datetime.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/datetime.cc b/datetime.cc index f200d493..0e821da6 100644 --- a/datetime.cc +++ b/datetime.cc @@ -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 // skipping through time. - struct std::tm * desc = std::gmtime(&moment); + struct std::tm * desc = std::localtime(&moment); if (years) desc->tm_mon = 0; 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; if (years || months) { - struct std::tm * desc = std::gmtime(&then); + struct std::tm * desc = std::localtime(&then); if (years) desc->tm_year += years; @@ -138,8 +138,7 @@ static void parse_inclusion_specifier(const std::string& word, } } -static inline -void read_lower_word(std::istream& in, std::string& word) { +static inline void read_lower_word(std::istream& in, std::string& word) { in >> word; for (int i = 0, l = word.length(); i < l; i++) word[i] = std::tolower(word[i]); |