---
title: "Comment by Furqan Ashraf on \"My Laptop Was in India, My Server Was in UTC, and My Bookings Were in Yesterday\" | Hashnode"
description: "The trek visibility bug points at the multi-country fix you're leaving open. A trek's end date belongs to the trek's location, not to the user or the server. If"
url: "https://hashnode.com/posts/the-timezone-bug-that-moved-my-bookings/6abfc151b37b5c733b00cfc9/comment/6b03db7bb5a517113d34e216"
---

[Discussion](https://hashnode.com/posts/the-timezone-bug-that-moved-my-bookings/6abfc151b37b5c733b00cfc9)

Comment [My Laptop Was in India, My Server Was in UTC, and My Bookings Were in Yesterday](https://hashnode.com/posts/the-timezone-bug-that-moved-my-bookings/6abfc151b37b5c733b00cfc9)

[Furqan Ashraf](https://hashnode.com/@jfreaks)

[1d ago](https://hashnode.com/posts/the-timezone-bug-that-moved-my-bookings/6abfc151b37b5c733b00cfc9/comment/6b03db7bb5a517113d34e216)

The trek visibility bug points at the multi-country fix you're leaving open. A trek's end date belongs to the trek's location, not to the user or the server. If you ever add treks in Nepal or Bhutan, hardcoding `+05:30` gives you the same bug in a new form. Nepal is `+05:45`, which is exactly the kind of offset a hardcoded value gets wrong without anyone noticing. Storing an IANA zone on each trek row, looked up once from the trailhead coordinates when the trek is created, lets your `AT TIME ZONE` fix take it from the row instead of a constant:

```
GET api.ipgeolocation.io/v3/timezone
→ time_zone.name: "Asia/Kathmandu"
```

Then the query is `AT TIME ZONE trek.tz`, and the same column handles DST for anything outside South Asia. I use the [timezone API](https://ipgeolocation.io/timezone-api.html) for that lookup since it accepts coordinates, a place name, or an IP. The IP option is handy for defaulting a user's display zone at signup.
