Wednesday, 7/13/2013
Here's the basic function that will give you the output presented above:
function getDateString(dateTime) { var weekday=new Array(); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; var dayOfWeek = weekday[dateTime.getDay()]; var month = dateTime.getMonth() + 1; var day = dateTime.getDate(); var year = dateTime.getFullYear(); return dayOfWeek + ', ' + month + '/' + day + '/' + year; }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.