# Why does Apollo Explorer return timestamp 2 hours earlier than my actual timezone?

**URL:** https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157
**Category:** GraphOS
**Tags:** studio
**Created:** [April 18, 2023, 7:07am UTC](https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157 "2023-04-18T07:07:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Arskeliss](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/arskeliss/32/4098_2.png) [@Arskeliss](https://community.apollographql.com/u/Arskeliss)
#### Post date: [April 18, 2023, 7:07am UTC](https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157/1 "2023-04-18T07:07:49Z")

</div>

Hello team,

I am using keystoneJS, which provides GraphQL as API, also an Explorer for developers to write their queries and mutations.  
Now I noticed that whenever i return data which has a timestamp, it returns two hours earlier than my actual timezone.

is there a way to set the correct timezone for the Apollo Explorer?

Thanks

---

<div class="post-metadata">

### Author: ![mkdangi21](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mkdangi21](https://community.apollographql.com/u/mkdangi21)
#### Post date: [April 20, 2023, 6:35am UTC](https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157/2 "2023-04-20T06:35:47Z")

</div>

Apollo Explorer itself does not provide a direct way to set the timezone. The timezone issue you’re experiencing is likely due to how the data is stored or retrieved in KeystoneJS, or how JavaScript is handling the Date objects.

Here are a few suggestions to handle timezones correctly:

1. Use UTC for storing dates in the database:

Store all dates in your database as UTC. This way, you have a consistent, unambiguous format to work with.

1. Convert dates to the desired timezone in your resolvers:

When retrieving data in your GraphQL resolvers, convert the dates to the desired timezone before returning them. You can use the `luxon` library to handle timezone conversions easily.

---

<div class="post-metadata">

### Author: ![Arskeliss](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/arskeliss/32/4098_2.png) [@Arskeliss](https://community.apollographql.com/u/Arskeliss)
#### Post date: [April 20, 2023, 6:38am UTC](https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157/3 "2023-04-20T06:38:06Z")

</div>

Thank you @mkdangi21 will try this also maybe converting the timestamp with Javascript Date functions, as last resort.

---

<div class="post-metadata">

### Author: ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)
#### Post date: [February 6, 2025, 8:49pm UTC](https://community.apollographql.com/t/why-does-apollo-explorer-return-timestamp-2-hours-earlier-than-my-actual-timezone/6157/4 "2025-02-06T20:49:03Z")

</div>


