diff options
Diffstat (limited to 'source/util/Clock.mc')
| -rw-r--r-- | source/util/Clock.mc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/util/Clock.mc b/source/util/Clock.mc index 4e2faf4..44a0e37 100644 --- a/source/util/Clock.mc +++ b/source/util/Clock.mc @@ -22,11 +22,17 @@ module Clock { // Current unix time (UTC seconds) plus the user's offset for clock skew. function nowUnix(offsetSeconds as Number) as Long { + if (TestMode.ON) { + return TestMode.NOW + offsetSeconds; + } return toUnsigned(Time.now().value()) + offsetSeconds; } // The trusted clock's unix time, or null when it isn't synced yet. function trustedUnix() as Long? { + if (TestMode.ON) { + return TestMode.NOW; + } try { return toUnsigned(Time.getCurrentTime({:currentTimeType => Time.CURRENT_TIME_RTC}).value()); } catch (e instanceof Time.RealTimeClockNotValidException) { |
