Javascript DateFormat for different timezones

后端 未结 9 2086
小蘑菇
小蘑菇 2020-12-16 16:42

I\'m a Java developer and I\'m used to the SimpleDateFormat class that allows me to format any date to any format by settings a timezone.

Date date = new Dat         


        
9条回答
  •  鱼传尺愫
    2020-12-16 16:57

    JavaScript does not have build in support for other time zone than the local one. You can only express a date in local time or in UTC time. There is no way to change the time zone offset of a Date object.

    Thus, there is no "neat" way to solve your problem.

提交回复
热议问题