How to get server timezone in javascript

前端 未结 3 2015
攒了一身酷
攒了一身酷 2021-01-21 10:59

I want to set different timezone in Javascript.Currently It is showing date and time zone of local machine or client\'s PC date /timezone.

Regards,

3条回答
  •  清酒与你
    2021-01-21 11:19

    There is no in-built functionality in JavaScript to do this.

    You could embed the time-zone in (e.g.) a hidden field on the page when it is rendered from the server, or implement some sort of http request to actively retrive it from the server.

提交回复
热议问题