A developer shares how they fixed a timezone bug in a JavaScript parking booking app where users in Italy booking midnight slots had times stored as 6 PM the previous day in a US-hosted database. The root cause was JavaScript's Date object automatically attaching local timezone metadata. The fix involved constructing a plain date-time string without timezone information before sending it to the API, ensuring the database stores exactly what the user selected.

3m read timeFrom neon.com
Post cover image
Table of contents
The problem: Timezone conversions adding unwanted metadataHow we fixed itWhy we love using Neon