Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

date format in jquery

	function formatDate(date) {
		var d = new Date(date),
		day = '' + d.getDate(),
		month = '' + (d.getMonth() + 1),
		year = d.getFullYear();

		if (month.length < 2) month = '0' + month;
		if (day.length < 2) day = '0' + day;

		return [day, month, year].join('-');
	}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #date #format #jquery
ADD COMMENT
Topic
Name
3+5 =