Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

datetime to date javascript

var currentDate = new Date();

var date = currentDate.getDate();
var month = currentDate.getMonth(); //Be careful! January is 0 not 1
var year = currentDate.getFullYear();

var dateString = date + "-" +(month + 1) + "-" + year;
Source by www.toptal.com #
 
PREVIOUS NEXT
Tagged: #datetime #date #javascript
ADD COMMENT
Topic
Name
3+2 =