Day 96: Current Date and Time of 100DaysCodingChallenge

Hello all, 

#day96 

Day96 

Today's my task was to Write a Program to Display the Current Date and Time.

I have started the 100 days of coding challenge to improve my programming skills..

Code : 

// program to display the date
// get local machine date time
const date = new Date();

const datetime = Date.now();

// get the date as a string
const n = date.toDateString();

// get the time as a string
//const time = datetime.toLocaleTimeString();

// display date
console.log('Date: ' + n);

// display time
console.log('Time: ' + datetime);


Output :     

 




Happy Coding:)

Thank you...      

Comments

Popular posts from this blog

Day 55: Pattern using loops of 100DaysCodingChallenge

Day 7: Square or Power Integer Numbers of 100DaysCodingChallenge

Day 45: Pattern using loops of 100DaysCodingChallenge