Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
APPSST
/
js
:
fecha.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
const fechaIngresoInput = document.getElementById('fechaIngreso'); // Crear una nueva fecha y formatearla como YYYY-MM-DD const hoy = new Date(); const anio = hoy.getFullYear(); const mes = ('0' + (hoy.getMonth() + 1)).slice(-2); // Agregar ceros iniciales si es necesario const dia = ('0' + hoy.getDate()).slice(-2); // Agregar ceros iniciales si es necesario const fechaActual = `${anio}-${mes}-${dia}`; // Establecer el valor del campo de fecha fechaIngresoInput.value = fechaActual;