Question
Missing value returned by clock() during DST transition
Lax Nea
0 reputation · 07 Apr 2024, 02:16 UTC
36.9K views0
Goal
We want to reliably convert local timestamps that may fall within DST gaps into Stata datetime values while preserving the original regional context.
Constraints
The clock() function uses the session’s tz setting and returns . for times that do not exist during a spring‑forward transition. The stored value is a UTC‑based millisecond count with no zone metadata, and %tc formatting applies the current tz at display time.
Unresolved Questions
- What strategy should be adopted to handle missing values generated by
clock()for non‑existent local times? - How can timezone identifiers be attached to datetime variables in Stata, or is a separate string variable the only viable workaround?
- Is there an existing or planned Stata feature that would automatically retain the original session
tzfor each datetime value?