Convert Javascript Date object to PST time zone

后端 未结 6 1843
野趣味
野趣味 2020-12-06 21:09

I need to pick a future date from calender, suppose the date I am selecting is 10/14/2014, now what I want is to send the date with the time to server, so that

6条回答
  •  萌比男神i
    2020-12-06 21:49

    I believe you can simply add 14 hours before converting to UTC.

    Or you can create a new Date object out of the UTC string:

    var date = new Date();
    date = date.addHours(14);
    var dateUTC = new Date(date.toUTCString());
    

提交回复
热议问题