Skip to content

Instantly share code, notes, and snippets.

@phoebejaffe
Created November 21, 2019 19:53
Show Gist options
  • Select an option

  • Save phoebejaffe/68176ad03108fe603ae8cdb9a6dee22a to your computer and use it in GitHub Desktop.

Select an option

Save phoebejaffe/68176ad03108fe603ae8cdb9a6dee22a to your computer and use it in GitHub Desktop.
gets a GMT date object, regardless of your timezone.
const thisMoment = new Date();
const gmtDate = new Date(thisMoment.getTime() + thisMoment.getTimezoneOffset() * 1000 * 60);
console.log(gmtDate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment