Ads by ProfitSence
Close

JS Date and time Code Example

Last Updated on Wednesday 5th Oct 2022

Functions to get or retrieve data

			
					let DT =  new Date();

console.log(DT.getDate()); // 9

console.log(DT.getDay());  // 5

console.log(DT.getFullYear()); // 2021

console.log(DT.getHours()); // 23

console.log(DT.getMilliseconds()); 371

console.log(DT.getMinutes()); // 29

console.log(DT.getMonth()); // 6

console.log(DT.getSeconds()); // 34

console.log(DT.getTime()); // 1625853574371