How to create UTC date in JS?
问题 When i try to create the date in UTC like new Date(Date.UTC(2013, 10, 7, 10, 3, 19)) i still receive Thu Nov 07 2013 12:03:19 GMT+0200 (FLE Standard Time) where it adds +2 hours. How to create just 2013-11-07 10:03:19 ? 回答1: The date you created is actually 2013-11-07 10:03:19 UTC, but when you print it, it will print the date in your local timezone. To extract the UTC date, you could try using toUTCString(), like so: Date(Date.UTC(2013, 10, 7, 10, 3, 19)).toUTCString() //"Thu, 07 Nov 2013 10