setDebugTimeOffsetMs function

void setDebugTimeOffsetMs(
  1. int offsetMs
)

Sets the debug-only offset nowMsClamped/todayEpochDayClamped add to the real wall clock before every read — FEAT-93's DebugQaOverlay "Time Travel" tab, letting a QA tester see a time-gated system (Daily Login/ Quest/Energy/Season Event) react to +2h/+24h/+7d without touching the OS clock (which routinely causes unwanted side effects elsewhere on the device). A no-op outside kDebugMode/kProfileMode — same posture as dlog (debug_log.dart) — so nothing outside an already debug-gated UI can ever move this, and it's always exactly 0 in a release build.

The offset itself is never persisted — only its EFFECT is (via the same maxMsSeen/maxEpochDaySeen watermark ratchet a real forward clock jump already causes, see this file's own class doc). Setting it back to 0 does NOT "undo" a prior jump's watermark advance, matching exactly how winding a REAL device clock back after a forward jump behaves too — a QA build's storage should be treated as burned/reset-worthy after deliberately time-traveling, same as after manually changing the system clock during testing today.

Implementation

void setDebugTimeOffsetMs(int offsetMs) {
  if (!kDebugMode && !kProfileMode) return;
  _debugTimeOffsetMs = offsetMs;
}