Fix single digit minutes & seconds
This commit is contained in:
parent
f10e0038f7
commit
c77559392a
@ -49,8 +49,8 @@ const timestampToHumanReadableDate = async(timestamp) => {
|
||||
const month = date.getMonth() + 1
|
||||
const year = date.getFullYear()
|
||||
const hours = date.getHours()
|
||||
const minutes = date.getMinutes()
|
||||
const seconds = date.getSeconds()
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
|
||||
const formattedDate = `${year}.${month}.${day}@${hours}:${minutes}:${seconds}`
|
||||
console.log('Formatted date:', formattedDate)
|
||||
|
Loading…
x
Reference in New Issue
Block a user