UTC keeps defaulting to UTC+02:00 Buchares

Describe the issue:

Hi I m building an agenda and I keep editing the dates and putting UTC:00:00 London, save it and when I go back to the agenda record it goes back to Bucharest +2 and is messing my times too so if I entered 08:00 it becomes 10:00

Is this a bug?

Regards

(Recommended) What’s the URL of the record or model in question?

  • Being able to see the issue in your real project is you for very helpful for troubleshooting. If you don’t provide the URL upfront, we’ll often have to ask you for it anyway, which just slows down our response time for you.
  • If you’re concerned about privacy, you can email us at support@datocms.com instead of posting here.

(Optional) Do you have any sample code you can provide?

Hey @atproductions,

Sorry for the confusion here. Our datetime handling is a little bit unclear sometimes.

This is actually a setting you can control in two different places:

  1. The time zone returned by the API is set in Configuration → Locales & timezone:

  2. The time zone displayed in the UI is separately configured in (your profile image) → Localization settings → Date preferred timezone

What is going on behind the scenes is that whenever you set a time field and save it, it gets converted to a timestamp in the backend, but not in your original time zone. Instead, we use one the two above time zones you specified: one for the API and another for the UI.

Does that help?

Hi Roger

Thank you so much :slight_smile:
It makes perfect sense thank you I did not know where to find it. It works like a charm.

Best Nicolae

1 Like