Skip to content Skip to sidebar Skip to footer

Javascript Set Timezone In Date Object Itself Like SetTimeOffset()

I want to change timezone in Date object itself, because device(web browser?) itself doesn't support timezone. How I change it? For example: var date = new Date(); // Value is 'Mon

Solution 1:

I want to change timezone in Date object itself, because device(web browser?) itself doesn't support timezone.

How I change it?

You can't. The ECMAScript Date object doesn't have a timezone, it's UTC internally. The offset is supplied by the host system.

If you want to support different time zones, write your own functions or use a library that supports them.


Post a Comment for "Javascript Set Timezone In Date Object Itself Like SetTimeOffset()"