I am creating a schedule for something on the east coast, and I need to create a date that always returns a date object/timestamp for this time.
So, if I open the page in Paris at 18:00, the "new myDate()"
should return 12:00.
Any suggestions on how I can do this with wither momentJS or just Javascript? The end result should be a javascript Date object.
If you want your timezone completely ignored, you can use the following approach:
Output:
You can do this with moment.js using
moment.utc()
.http://momentjs.com/docs/#/parsing/utc/
The way
moment.utc
works is by setting a flag internally to usegetUTCMinutes
instead ofgetMinutes
, thus the output is the same in all timezones.