Fix time?

This commit is contained in:
Christopher Cookman 2025-08-20 23:08:51 -06:00
parent e340582c7a
commit d04746a5d8

View file

@ -12,7 +12,7 @@ app.get('/time.php', (req, res) => {
try {
const date = new Date();
const options = { timeZone: tz, hour12: false };
const pad = n => n.toString().padStart(2, '0');
const pad = n => n.toString().padStart(2, ' ');
const year = date.toLocaleString('en-GB', { ...options, year: 'numeric' });
const month = pad(date.toLocaleString('en-GB', { ...options, month: '2-digit' }));
const day = pad(date.toLocaleString('en-GB', { ...options, day: '2-digit' }));