DateTime Value is wrong

I am making a booking system where the user can either book 1 or 2 days. So, for example if the user pick 24.05.2023, the person can book the machine for either 24.05.2023 or 24.05.2023 - 25.05.2023.

To obtain this, I have a Calendar Data Source showing days in each month. Additionally, I am using the following Value Processor.

The issue is that the DateTime Value always shows the date before the date that is selected. For example in the following example, the user pick a booking for 24.05.2023 - 25.05.2023. Then, ideally the DateTime Value should be 24.05.2023, and then I have made a function returning DateTime Value + 1 to obtain the next date (25.05.2023).

However, DateTime Value returns 23.05.2023 (22 pm). I think the issue is some sort of time zone issue. But, I have set the default Calendar Locale to “Norsk Bokmål”.

Do you have any idea what the problem could be, and how I could fix it without manually do +1 for the DateTime Value? I just want the exact time (Oslo time zone) for when the date is picked.

Thanks :slight_smile:

Hi,

This is correct:

If the user is looking at the raw value stored as “midnight” for a given date, it is always in UTC time. For Oslo, summer time, that means saving midnight at 24th of may will be stored as 2023-05-23T22:00:00.000Z since that UTC time represents midnight in Oslo.
However, using that datetime in your Apps and Logic will behave correctly as “start of day” when you are using the App in Oslo.

Hopefully this will make it a bit more clear :slight_smile:

1 Like

Thank you! It works :slight_smile:

1 Like