I need to Convert epoch time to human-readable date
Timestamp value is: = '1685595600'
Need to convert above timestamp like this
date = 01 Month = 06 year = 2023
How should it be done?
I need to Convert epoch time to human-readable date
Timestamp value is: = '1685595600'
Need to convert above timestamp like this
date = 01 Month = 06 year = 2023
How should it be done?
You could create a new Date object from the timestamp and then use its methods to retrieve the day, month and year.
const timestamp = new Date().getTime(); // current timestamp
const date = new Date(timestamp);
const day = date.getUTCDate();
const month = date.getUTCMonth() + 1; // January is 0
const year = date.getUTCFullYear();
console.log(day, month, year);