Skip to content

Instantly share code, notes, and snippets.

@Prosen-Ghosh
Created September 7, 2017 18:22
Show Gist options
  • Save Prosen-Ghosh/76cc7df3d6ae1f33b011073b4fa42732 to your computer and use it in GitHub Desktop.
Save Prosen-Ghosh/76cc7df3d6ae1f33b011073b4fa42732 to your computer and use it in GitHub Desktop.
Get Day Name In JavaScript
var getDayName = function(dateFormate){
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
date = new Date(dateFormate);
return days[date.getDay()];
}
getDayName("08/01/2017"); // MM/DD/YYYY
// "Tuesday"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment