Working With Dates: Locale String to Alternate time zone

Hey Vlad and team, this block looks really promising but I’m having trouble getting it to work based solely off of the MDN documentation that it’s linked to.
image

Apologies, since I’m almost positive this is linked to my lack of formal dev experience working with dates. Would it be possible to get a bit more documentation or codeless examples here in this thread for using it in practice?

For instance, let’s say that I have a date string that I know is in America/Chicago timeZone (US central time). I need to convert this to another timeZone (lets say Hawaii) in a way that doesn’t require me to manually account for the boundaries of daylight savings time.

I think that I can use this block to simply say, “this datetime string is in CT (central time), please convert it to HT (Hawaii)” and the block will do the conversion while accounting for the daylight savings time appropriately given the date in the string.

Is this correct? If so, could you share some examples? Another might be to take a datetime string in CT then convert to UTC automatically accounting for daylight savings time, which I think I might also be able to accomplish with another combination of blocks.

Thanks!
James

Hello @James_Hereford

We are looking into your issue and will help as soon as possible.

Regards,
Zahar

Here are some examples of using this block.


I hope this helped.

Regards,
Zahar

Hi Zahar,

Thank you for this. I am still going through documentation trying to find the appropriate locale encodings. Can you share a link to where you retrieved HAW-US?

Can you confirm that in your examples your are converting FROM “America/Chicago” or “EET”, TO “haw-US”? Or is it the other way around?

Would you be willing to provide an example where a date string is converted FROM whatever locale the user was in when it was input (i.e. America/Chicago if the user is in central time, America/Los_Angeles if they are on the west coast) TO UTC?

Thanks!
James

Yes, it is.

I typed “Hawaii locale” into my browser’s search bar and followed the first link)

Regards,
Zahar

Thank you Zahar! I appreciate the additional documentation and examples for using this function.