I need to get the date ( day of the month ) from UNIX epoch time . I can get the date from this:
new Date ().getDate()
But I need to get from Date.now(), Date.now().getDate() gives me an error..
How to get that date ( day of the month ) ??
I need to get the date ( day of the month ) from UNIX epoch time . I can get the date from this:
new Date ().getDate()
But I need to get from Date.now(), Date.now().getDate() gives me an error..
How to get that date ( day of the month ) ??
You can pass number of miliseconds to Date constructor like:
let now = Date.now();
let date = new Date(now).getDate();
console.log(date);