inline FLEX_ALWAYS_INLINE_FLATTEN void operator()(flex_date_time& t, const flex_float u) const { int64_t integral_part = std::floor(u); int64_t us_part = (u - integral_part) * flex_date_time::MICROSECONDS_PER_SECOND; t.set_posix_timestamp(t.posix_timestamp() - integral_part); auto microsecond = t.microsecond() - us_part; if (microsecond < 0) { t.set_posix_timestamp(t.posix_timestamp() - 1); microsecond += flex_date_time::MICROSECONDS_PER_SECOND; } t.set_microsecond(microsecond); }
inline FLEX_ALWAYS_INLINE_FLATTEN void operator()(flex_date_time& t, const flex_int u) const { t.set_posix_timestamp(t.posix_timestamp() - u); }