Skip to content Skip to sidebar Skip to footer

How To Get The Time Of Specific Timezone Using Javascript, But Without Being Relevant To The Current System Time?

Now, before you mark this as a duplicate, please note that all the useful answers in the possible duplicate provide functions which work in relation to the current system time, whi

Solution 1:

Hope to not be wrong but javascript is loaded on user machine, not on the server so you will allway get the visitor date/time using javascript. you can use php to get the date/time because is loaded on the server and pass the dates to javascript.

Hope this help

Solution 2:

You need to use a timezone library to do this in JavaScript. See my answer here.

The scripts are small, but because they require the timezone database, it can get unwieldy for a client application. You're probably better off doing the conversion server side. Perhaps the pytz library will be useful to you.

Post a Comment for "How To Get The Time Of Specific Timezone Using Javascript, But Without Being Relevant To The Current System Time?"