Juan Felipe Zapata Moreno c6c2f78d16 Initial Commit
2025-08-12 09:36:02 -06:00

23 lines
545 B
JavaScript

/**
* Permite convertir las fechas en el formato preestablecido deseado
*/
const format = 'sv-SE';
/* Obtiene la fecha actual en el formato deseado */
const getDate = (value = null) => {
const date = (value)
? new Date(value)
: new Date();
return date.toLocaleDateString(format)
}
/* Obtiene la horaa actual en el formato deseado */
const getTime = (value = null) => {
const date = (value)
? new Date(value)
: new Date();
return date.toLocaleTimeString(format)
}
export { getDate, getTime };