juanjkdate
Version:
Utilidad para manejar fechas en formato timestamp y long time.
23 lines (20 loc) • 464 B
JavaScript
function getTimestamp() {
return Date.now()
}
function getLongTime(locale = 'es-ES') {
const options = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
timeZoneName: 'short'
}
return new Date().toLocaleDateString(locale, options)
}
module.exports = {
getTimestamp,
getLongTime
}