Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
date string to local
function dateToLocal(date) {
let localOffset = new Date().getTimezoneOffset() * 60 * 1000;
let d = new Date(Date.parse(date));
return new Date(d.getTime() + localOffset);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment