Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get yyyy-mm-dd hh:mm from date javascript

var d = new Date,
    dformat = [(d.getMonth()+1).padLeft(),
               d.getDate().padLeft(),
               d.getFullYear()].join('/') +' ' +
              [d.getHours().padLeft(),
               d.getMinutes().padLeft(),
               d.getSeconds().padLeft()].join(':');
//=> dformat => '05/17/2012 10:52:21'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #date #javascript
ADD COMMENT
Topic
Name
4+3 =