Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

As Day Light Save started, our Form app is not working!!

Avatar

Level 4

Hello

Currently we are in USA - EST time zone

By using the below JS I'am able to determne the local time zone, we are getting our zone as EST from the below JS until last week. well.

But, today we are getting it as EDT!!

Pls. let me know the correct JS snippet, wherein irrespective of Day Light Saving we must get see/get as EST, I mean, in all seaons we want the JS's outcome as EST only

Pls. help us in this regard

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I don't think there is any system function to return the time zone regardless of daylight saving.

So I can only suggest you have your own mapping table from day light saving time.  By that I mean simply a JavaScript object;

var map = {"EST":"EDT", "CST":"CDT" }

So

map["EST"]

Would return "EDT".

Bruce

View solution in original post

7 Replies

Avatar

Level 10

Hi,

I'm not sure I understand, do you want a JS snippet that always returns the string "EST" ?

Under what situations do you want it to return something else?

Regards

Bruce

Avatar

Level 4

Thank you.

Yes, pls. I always want that my JS returns simply EST, even today (yes, I am aware that now its EDT in NewYork) beacsue we are sending this time zone to a back end system, where in only EST is there (EDT is invalid in that back end system)

Just for example I am giving as EST / EDT

I mean, it should be the same case w/ all zones, I mean, one more example, I need a JS which returns CST all around the year, not EDT if I am in Houston

Pls. advise us a JS, which retuns non-day light save time zone (examples are EST / CST) in all seasons over roound the year

Regards

Avatar

Correct answer by
Level 10

Hi,

I don't think there is any system function to return the time zone regardless of daylight saving.

So I can only suggest you have your own mapping table from day light saving time.  By that I mean simply a JavaScript object;

var map = {"EST":"EDT", "CST":"CDT" }

So

map["EST"]

Would return "EDT".

Bruce

Avatar

Level 4

Hello,

We are a multi national private company, located in Washington DC, we are looking for a expert LC developer with excellent JS expertise, its 3 months project, pls. reply ASAP if you are available, interviews will be immediate (no remote work pls.)

Thank you