Hello!
// 1. Get the current date and time
const now = new Date();
// 2. Extract components
const year = now.getFullYear();
// Months are 0-indexed (0 = Jan, 11 = Dec), so add 1
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hour = String(now.getHours()).padStart(2, '0');
// 3. Construct the final URL string
const targetUrl = `https://example.com{year}/${month}/${day}/${hour}`;
// 4. Load the new website
window.location.href = targetUrl;