summaryrefslogtreecommitdiff
path: root/src/times.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-28 01:17:54 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-28 01:17:54 -0400
commitcc532c31aa8aa745d6d02c5c0cb22b3d75866590 (patch)
tree47eaa051abf286a08fe4406f41dacab4407ac352 /src/times.h
parent559566751ddd29caf2cd74c3d44982c907bd1020 (diff)
downloadfork-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.h8
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())