From cc532c31aa8aa745d6d02c5c0cb22b3d75866590 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 28 Oct 2009 01:17:54 -0400 Subject: Added TRUE_CURRENT_TIME() macro Because CURRENT_TIME() can now be a past date if --now is used. --- src/times.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/times.h') 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 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()) -- cgit v1.2.3