I have a simple usage example, but I cannot figure out how to convert from GMT / UTC to local time in moment.js.
Example:
var gmtDateTime = moment.utc("2015-10-24 20:00", "YYYY-MM-DD HH").format('YYYY-MMM-DD h:mm A');
console.log(gmtDateTime) emits 2015-Oct-24 8:00 PM , which is correct. Now I just want to convert this to my local time, which happens to be Mountain Daylight Time. Therefore, the correct conversion date will be 2015-Oct-24 2:00 PM , because I am 6 hours earlier than GMT / UTC.
How can this be done simply with a moment. js? (THANKS!)
source share