Create a Date with a set timezone without using a string representation

前端 未结 23 1111
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 01:48

I have a web page with three dropdowns for day, month and year. If I use the JavaScript Date constructor that takes numbers, then I get a Date obje

23条回答
  •  你的背包
    2020-11-22 02:15

    This may help someone, put UTC at the end of what you pass in to the new constructor

    At least in chrome you can say var date = new Date("2014-01-01 11:00:00 UTC")

提交回复
热议问题