Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?How to convert a Date to UTC?

To find out more, please refer to: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?

To find out more, please refer to: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?

To find out more, please refer to: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date

added 120 characters in body
Source Link
Chase
  • 29.6k
  • 1
  • 52
  • 49

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?

To find out more, please refer to: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?

To find out more, please refer to: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date

Source Link
Chase
  • 29.6k
  • 1
  • 52
  • 49

Try the following:

var date = new Date(2012, 12, 5, 18, 0, 0, 0); var date_utc = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); 

The Date function can be used the following ways:

var d = new Date(); var d = new Date(milliseconds); var d = new Date(dateString); var d = new Date(year, month, day, hours, minutes, seconds, milliseconds); 

This was taken from a related post here: How to convert a Date to UTC?