Dates and Times

let val;

const today = new Date();
let birthday = new Date('1984-11-24 06:25:00');
birthday = new Date('November 24 1984');
birthday = new Date('84/11/24');

val = today.getMonth();
val = today.getDate();
val = today.getDay();
val = today.getFullYear();
val = today.getHours();
val = today.getMinutes();
val = today.getSeconds();
val = today.getMilliseconds();
val = today.getTime();

birthday.setMonth(2);
birthday.setDate(12);
birthday.setFullYear(1988);
birthday.setHours(3);
birthday.setMinutes(30);
birthday.setSeconds(22);

console.log(birthday);
Was this page helpful?

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *