Skip to content

Instantly share code, notes, and snippets.

@alexkirsz
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkirsz/78fe94eb84451a55ba9e to your computer and use it in GitHub Desktop.
Save alexkirsz/78fe94eb84451a55ba9e to your computer and use it in GitHub Desktop.
Date to/from date and time inputs
let [date, time] = dateObj.toISOString().split('T');
time = time.split('.')[0].split(':').slice(0, 2).join(':');
let dateObj = new Date(`${date}T${time}.000Z`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment