UNPKG

@mongez/gnz

Version:

Generator Z, the next generation of scaffolding tools.

11 lines (10 loc) 472 B
function formatDate(date = new Date()) { const pad = num => num.toString().padStart(2, "0"); const day = pad(date.getDate()); const month = pad(date.getMonth() + 1); const year = date.getFullYear(); const hours = pad(date.getHours()); const minutes = pad(date.getMinutes()); const seconds = pad(date.getSeconds()); return `${day}-${month}-${year}_${hours}-${minutes}-${seconds}`; }export{formatDate};//# sourceMappingURL=format-date.js.map