Skip to content

Instantly share code, notes, and snippets.

@CoeusCC
Last active June 30, 2017 18:37
Show Gist options
  • Save CoeusCC/acd7e4d92e2413f7830e4342b25a930f to your computer and use it in GitHub Desktop.
Save CoeusCC/acd7e4d92e2413f7830e4342b25a930f to your computer and use it in GitHub Desktop.
function get_formatted_date(date_string) {
const raw = new Date(date_string);
const day = ("0" + raw.getDate()).slice(-2);
const month = ("0" + (raw.getMonth() + 1)).slice(-2);
const year = raw.getFullYear().toString().slice(-2);
return month + '/' + day + '/' + year;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment