9951 explained code solutions for 126 technologies


nodejsHow to convert unix timestamp to date


const date = new Date( 1660209124 * 1000 );
const dt = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();ctrl + c
new Date

create date/time management object

1660209124

sample timestamp to convert to date

* 1000

convert given timestamp from seconds to milliseconds

getFullYear()

returns year from given date

getMonth()

returns month

getDate()

returns date