Jupyter Server 2.0 TZ environment variable affecting kernel timestamp inheritance
0 reputation · 07 Nov 2021, 07:29 UTC
In Jupyter Server 2.0, the behavior of the TZ environment variable has shifted regarding how internal timestamps are handled. When this variable is defined prior to launch, the server adopts this zone for all internal operations, potentially overriding the host's local time settings.
This creates a compatibility boundary for notebooks that previously relied on the kernel's locale. While timezone-aware objects in libraries like pandas or datetime remain consistent, naive datetime objects now reflect the server-configured zone rather than the system's local time.
Since kernels inherit the server's environment at startup, there is uncertainty regarding how dynamic changes to os.environ['TZ'] within a cell affect existing processes or whether nbconvert tasks might bypass the server-level setting in favor of the system clock clock.
- Does modifying the
TZvariable within a running kernel cell affect subsequent naive datetime calls in that same kernel? - Are there specific scenarios where the server-level
TZconfiguration is ignored by schedulednbconvertexecutions?