Skip to content

Instantly share code, notes, and snippets.

@kylekatarnls
Last active January 30, 2019 12:07
Show Gist options
  • Save kylekatarnls/623db251673a7916e7978bdbbc50fd5e to your computer and use it in GitHub Desktop.
Save kylekatarnls/623db251673a7916e7978bdbbc50fd5e to your computer and use it in GitHub Desktop.
var dateString = '2018-01-25'; // can be numbers concat: year + '-' + month + '-' + day
var timeString = '12:30';
var date = new Date(dateString + 'T' + timeString); // use the `T` separator for cross-browser compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment