Forms DateTimes Managing Timezone

  • Goal: Have a datetime input on a Forms that can manage the timezone.

  • Steps: I default the Datetime to

{{ new Date() }}

If it is not adjusted the value comes back perfectly.

2024-08-12T21:53:49.427-0700

However if the user modifies the dattime component it will only give me the date and time they set but not their timezone offset

2024-08-12T21:53:49.427

I feel it is very important to be able to have a form that can capture the timezone in the date & time feilds

1 Like

I agree with you, the default behavior should include the timezone offset.

In the meantime, you can separately grab the users timezone through their browser using let offset = -(new Date().getTimezoneOffset() / 60)

getTimezoneOffset returns the offset in minutes, so you need to convert it to hours.

Hopefully this helps!

1 Like

That is a great idea. I will use that Thanks