Skip to content

Commit

Permalink
Fixed Time Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HastDu authored Oct 24, 2024
1 parent f5c58f7 commit 86ea1c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const period = document.getElementById("period"); //for later ;)

var months = ['January','Febuary','March','April','May','June','July','August','September','October','November','December']

var ender = "AM"
setInterval(() => {
const now = new Date();
const mont = now.getMonth();
const day = now.getDate();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
const ender = "AM"


const month = months[mont] //selects the month from the array
document.getElementById("period").innerHTML = `Today is: ${month} ${day}, ${hours}:${minutes}:${seconds} ${ender}`; //changes the H1
Expand Down

0 comments on commit 86ea1c0

Please sign in to comment.