Is there a jQuery function to convert time zones?

For my needs, I care mainly about continental southern (Pacific, mountain, central and eastern time zones), but the bonus will include others.

I wonder if there is a well-known jQuery function that will return values ​​that take into account daylight saving time when changing from one hour to another, taking into account daylight saving rules.

I believe this will be called something like this:

var pertinentDatetime = getDateTimeFor(thisDateTime, thisTimeZone, desiredTimeZone); 

Does anyone know or know such a function?

+4
source share
1 answer

No, jQuery does not have built-in support for processing time information, such as time zones.

Check out Moment .

The following should provide what you want:

 moment().zone(); 
+2
source

Source: https://habr.com/ru/post/1497121/


All Articles