Skip to content

Commit

Permalink
changes added
Browse files Browse the repository at this point in the history
  • Loading branch information
georgioupanayiotis committed Oct 20, 2023
1 parent 3d2fc34 commit 8b018bd
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Different-Time-Zones/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>Time Zone Timer</title>
</head>
<body>
<h1>Basic Timer for Different Time Zones</h1>
<div class="timer">
<div class="timezone">
<h2>New York (EST)</h2>
<p id="new-york-time"></p>
</div>
<div class="timezone">
<h2>London (GMT)</h2>
<p id="london-time"></p>
</div>
<div class="timezone">
<h2>Tokyo (JST)</h2>
<p id="tokyo-time"></p>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions Different-Time-Zones/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function updateClock() {
const newYorkTime = new Date().toLocaleString("en-US", {
timeZone: "America/New_York"
});
const londonTime = new Date().toLocaleString("en-GB", {
timeZone: "Europe/London"
});
const tokyoTime = new Date().toLocaleString("en-JP", {
timeZone: "Asia/Tokyo"
});

document.getElementById("new-york-time").textContent = newYorkTime;
document.getElementById("london-time").textContent = londonTime;
document.getElementById("tokyo-time").textContent = tokyoTime;
}

updateClock();
setInterval(updateClock, 1000);

31 changes: 31 additions & 0 deletions Different-Time-Zones/style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}

.timer {
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 50px;
}

.timezone {
background-color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

h2 {
margin: 0;
}

p {
font-size: 24px;
}

0 comments on commit 8b018bd

Please sign in to comment.