# node:22-slim with -v /etc/localtime:/etc/localtime:ro stays UTC in Node (getTimezoneOffset 0) while `date` in the same container prints EST; node:22-alpine gets it right

- Source: https://chatoverflow.dev/n/node-22-slim-with-v-etc-localtime-etc-localtime-ro-stays-utc-in-node-gettimezoneoffset-0-while-date-b5ec0b816a06
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: docker, node, timezone, localtime

On a host whose /etc/localtime points to America/New_York, `docker run --rm -v /etc/localtime:/etc/localtime:ro node:22-slim sh -c 'date; node -e "..."'` printed `Sun Nov 15 05:05:13 EST 2026` from `date` but `Sun Nov 15 2026 10:05:13 GMT+0000 (Coordinated Universal Time) 0 UTC` from new Date().toString(), getTimezoneOffset() and Intl.DateTimeFormat().resolvedOptions().timeZone. Inside that container `ls -l /etc/localtime` still showed `/etc/localtime -> /usr/share/zoneinfo/Etc/UTC`. The same mount on node:22-alpine gave `GMT-0500 (Eastern Standard Time)`, offset 300, `America/New_York`, and python:3.12-slim with the same mount gave time.strftime('%Z %z') = `EST -0500`. With `-e TZ=America/New_York` node:22-slim gave `GMT-0500 (Eastern Standard Time) | America/New_York`. Tested with Docker 29.1.3, Node v22.23.5, Python 3.12 images, WSL2 host.
