Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Sep 06, 2023 01:03 AM - edited Sep 06, 2023 01:10 AM
I would like to parse a date string of "2023-02-10", with no time information, into a specific timezone (Europe/Malta). We use daylight savings, so right now, 2023-02-10 00:00 Malta time would be 2023-02-09 22:00 GMT. For this reason, I cannot specifically add a timezone of +2 because this will chagne to +1 later in October.
I noticed DATETIME_PARSE() takes a locale as the 3rd parameter. However, this does not seem to be documented at all in the formula reference. I've tried using values like "Europe/Malta", which works in SET_TIMEZONE(), but doesn't do anything. I've also experimented with SET_TIMEZONE(), but that seems the other way round, to convert an existing Airtable date with a particular timezone.
Basically, what I would like is something where for example could parse "2023-02-10" into the Malta timezone.
Solved! Go to Solution.
Sep 06, 2023 03:26 AM - edited Sep 06, 2023 03:29 AM
Airtable is not the best platform to work with if you’re dealing with anything time zone related (and especially if you’re dealing with multiple time zones), but my sample time zone base & training video in the Airtable Universe is the most comprehensive time zone resource that is currently available for Airtable:
p.s. If you have a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld
Sep 06, 2023 02:19 AM
You can use the DATEADD() function to offset the number of 'hours'
Sep 06, 2023 02:30 AM
That wouldn't work, as the timezone hours changes from +1 to +2 depending on daylight saving.
Sep 06, 2023 03:05 AM
Can you not just set the Timezone in Formatting to Europe/Malta then?
Sep 06, 2023 03:23 AM
No, as if you parse a date of 2023-02-10, and then show it in Malta time, it shows as 2023-02-09 22:00, as the parsing does it in GMT. Also, I do not want to hardcode it to Malta - that was to give an example.
The use case is that I have bookings coming in from a channel manager, who have a checkin & checkout date. There is no concept of timezones, however based on the property location, I want to offset the checkin to be the timezone of the place.
For example, a checkin date in Malta of 23/09/2023 would mean 22/09/2023 22:00 in GMT. A checkin in Argentina of same checkin 23/09/2023 would be 23/09/2023 04:00 in GMT.
Sep 06, 2023 03:26 AM - edited Sep 06, 2023 03:29 AM
Airtable is not the best platform to work with if you’re dealing with anything time zone related (and especially if you’re dealing with multiple time zones), but my sample time zone base & training video in the Airtable Universe is the most comprehensive time zone resource that is currently available for Airtable:
p.s. If you have a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld
Sep 06, 2023 03:31 AM
That's very similar to what I'm looking for. I was just going to post a very similar solution as I figured out there is no native way. I was using more columns and extracting the HOUR from the timezone, and doing some calculations.
Your solution is definitely way cleaner than what I came up with, thanks for your answer!
Sep 06, 2023 03:33 AM
You’re welcome! Glad I could help! 😀