Skip to content

Instantly share code, notes, and snippets.

@janeklb
Created Jan 27, 2013
Embed
What would you like to do?
create javascript date objects using date strings, in the user's timezone
function dateInLocalTimezone(simpleDateString) {
var date = new Date(simpleDateString), millis = date.getTime();
date.setTime(millis + date.getTimezoneOffset() * 60 * 1000);
return date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment