Copyright 2024 Taco Tribe
// URL dari API WorldTimeAPI
const apiUrl = 'http://worldtimeapi.org/api/ip';
// Mengambil data dari API
fetch(apiUrl)
.then(response => response.json())
.then(data => {
// Mendapatkan tahun dari API
const currentYear = new Date(data.datetime).getFullYear();
// Memperbarui elemen dengan ID 'yearFooters'
const yearFooterElement = document.getElementById('yearFooters');
if (yearFooterElement) {
yearFooterElement.textContent = currentYear;
}
})
.catch(error => {
console.error('Error fetching the year:', error);
});