Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get current data and time in javascript

To get time and date you should use

    new Date().toLocaleString(); >> "09/08/2014, 2:35:56 AM"

To get only the date you should use

    new Date().toLocaleDateString(); >> "09/08/2014"

To get only the time you should use

    new Date().toLocaleTimeString(); >> "2:35:56 AM"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #current #data #time #javascript
ADD COMMENT
Topic
Name
3+7 =