var schedule = {
start_at = Date ( '2017-10-10' ), // Not editable - this data is being handed off by an ORM
...
};
// Mon Oct 09 2017 20:00:00 GMT-0400 (Eastern Daylight Time)
console.log ( schedule.start_at );
Is it possible to alter the time of an ISO Date to match 00:00:00 of the current timezone, so the output would, in this case, be Tue Oct 10 2017 00:00:00 GMT-0400 (Eastern Daylight Time)?
I have experimented using moment.utc (), but that had only helped to format a date to a string. The output needs to be a Date object that which be passed along some further logic.
I have spent hours looking up the Moment.js documentation but had found nothing that I could use to solve this problem.
(Off note: I am adding this to the list of cons in using Node.js for API/Server development. ISO Date management has been such a nightmare in my experience.)
EDIT:
So I am mistaken. It turns out that schedule.start_at is a Date object set to Mon Oct 09 2017 20:00:00 GMT-0400 (Eastern Daylight Time). [question changed to reflect]. My question still remains, how may I alter a date object to change the timezone while maintaining the specified time?