Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to use current data in javascript

var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
Comment

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"
Comment

PREVIOUS NEXT
Code Example
Javascript :: nuxt router go back 
Javascript :: flutter decoration image 
Javascript :: hwo to create an array filled with sequencial numbers 
Javascript :: js check if value is not empty string 
Javascript :: discord.js change bot status 
Javascript :: if radio checked jquery 
Javascript :: how to check if a json object contains a key in jquery 
Javascript :: search in a table jquery 
Javascript :: javascript play sound onclick 
Javascript :: jmeter mac 
Javascript :: parse integer javascript 
Javascript :: move list items up and down using javascript 
Javascript :: angular get current time 
Javascript :: remove negative sign from number javascript 
Javascript :: javascript subtract days from date 
Javascript :: error: listen eaddrinuse: address already in use 0.0.0.0:5555 
Javascript :: html tag run only after whole page is loaded 
Javascript :: html loop through array 
Javascript :: how to remove trailing space in string js 
Javascript :: react native activity indicator 
Javascript :: put two buttons in a row in react native 
Javascript :: discord login with token 
Javascript :: nodemail self signed certificate in certificate chain 
Javascript :: once content is loaded run function 
Javascript :: remove item jquery 
Javascript :: document ready without jquery 
Javascript :: round to nearest hundredth javascript 
Javascript :: remove react native cli mac 
Javascript :: ignore logs on android expo 
Javascript :: javascript degree to radians 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =