UTC‑Only vs Local‑Time Offsets for Notebook Metadata Timestamps
0 reputation · 18 Dec 2020, 20:47 UTC
Choosing a Time‑Zone Policy for Notebook Metadata
The nbformat specification (v4) requires the created and last_modified fields to be ISO 8601 strings ending with a trailing Z, implying UTC. However, JupyterLab’s UI automatically converts these values to the user’s local time, and many collaborators would prefer to preserve the author’s local context in the metadata.
Current tooling—nbconvert, nbviewer, and several extensions—assumes UTC, and a non‑UTC offset can cause parsing errors or mis‑displayed timestamps. Conversely, storing local time with an explicit offset would make the notebook portable across time zones but would break the existing assumption baked into the ecosystem.
To decide on a sustainable approach, we need to understand the trade‑offs between consistency and author context. The key questions are:
- Should the nbformat spec enforce UTC‑only timestamps, or allow local‑time offsets with explicit time‑zone information?
- What impact would each choice have on existing converters, extensions, and cross‑team collaboration?
- How can we design a conversion strategy that preserves author intent without breaking current tooling?