ptzdate
v1.0.3
Published
Una utilidad para manejar fechas en formato timestamp y long time.
Readme
PlatziDate 📅
Una utilidad para manejar fechas en formato timestamp y long time.
Instalación
npm install ptzdateUso
const { getTimestamp, getLongTime } = require('ptzdate');
// Obtener timestamp (milisegundos desde 1970)
const timestamp = getTimestamp();
console.log(timestamp); // 1730073600000
// Obtener fecha formateada en español
const fecha = getLongTime();
console.log(fecha); // "martes, 28 de octubre de 2025, 14:30:45 GMT-5"
// Cambiar el idioma/región
const fechaEN = getLongTime('en-US');
console.log(fechaEN); // "Tuesday, October 28, 2025, 2:30:45 PM GMT-5"API
getTimestamp()
Devuelve el timestamp actual en milisegundos.
getLongTime(locale)
Devuelve la fecha y hora actual en formato largo.
- locale (opcional): Código de idioma/región. Por defecto:
'es-ES'
Licencia
MIT
