diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-28 01:17:54 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-28 01:17:54 -0400 |
commit | cc532c31aa8aa745d6d02c5c0cb22b3d75866590 (patch) | |
tree | 47eaa051abf286a08fe4406f41dacab4407ac352 /src/times.h | |
parent | 559566751ddd29caf2cd74c3d44982c907bd1020 (diff) | |
download | fork-ledger-cc532c31aa8aa745d6d02c5c0cb22b3d75866590.tar.gz fork-ledger-cc532c31aa8aa745d6d02c5c0cb22b3d75866590.tar.bz2 fork-ledger-cc532c31aa8aa745d6d02c5c0cb22b3d75866590.zip |
Added TRUE_CURRENT_TIME() macro
Because CURRENT_TIME() can now be a past date if --now is used.
Diffstat (limited to 'src/times.h')
-rw-r--r-- | src/times.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/times.h b/src/times.h index 035d86cd..69e3af51 100644 --- a/src/times.h +++ b/src/times.h @@ -69,11 +69,11 @@ inline bool is_valid(const date_t& moment) { extern optional<datetime_t> epoch; #ifdef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK -#define CURRENT_TIME() \ - (epoch ? *epoch : boost::posix_time::microsec_clock::universal_time()) +#define TRUE_CURRENT_TIME() (boost::posix_time::microsec_clock::universal_time()) +#define CURRENT_TIME() (epoch ? *epoch : TRUE_CURRENT_TIME()) #else -#define CURRENT_TIME() \ - (epoch ? *epoch : boost::posix_time::second_clock::universal_time()) +#define TRUE_CURRENT_TIME() (boost::posix_time::second_clock::universal_time()) +#define CURRENT_TIME() (epoch ? *epoch : TRUE_CURRENT_TIME()) #endif #define CURRENT_DATE() \ (epoch ? epoch->date() : boost::gregorian::day_clock::universal_day()) |