
How to create a Clocks and Calendars
Before We Start
Every developer needs clean and modern elements to develop their websites, It contains pictures and a user interface element within a website. The most important one and the first section that the user sees when the user enters a website. How to create a Clocks and Calendars
So if you are a person who wishes to develop a website, you have to know how to create that properly.

How to create a Clocks and Calendars
We are here to solve your problem. In this article we discuss how to create these elements. Before we start please read the below articles which easier you to understand the process, if you are new to development.
Step 1 – Add HTML
It’s too easy and simple. Just copy and paste below code in your HTML editor between <body> </body> tag.
<div class='calendar'>
<div class='day'></div>
<div class='month'>
<div class='month-name'></div>
</div>
<div class='number'></div>
</div>
<div class='contain'>
<div class='caltwo'>
<div class='daytwo'></div>
<div class='monthtwo'></div>
<div class='numtwo'></div>
</div>
<div class='clock'>
<div class='hour time'></div>
<div class='min time'></div>
<div class='sec time'></div>
</div>
</div>
<div class='meter'>
<div class='hours timer'></div>
<div class='minutes timer'></div>
<div class='seconds timer'></div>
</div>
Step 2 – Add CSS
Copy and paste below code in your HTML editor between <style></style> tag.
<style>
@import url(https://fonts.googleapis.com/css?family=Istok+Web:400,700);
@import url(https://fonts.googleapis.com/css?family=Lato:300,400,700,900);
html, body {
background-color: #00DBDE;
background-image: linear-gradient(90deg, #00dbde 0%, #fc00ff 100%);
}
.calendar {
font-family: "Istok Web",sans-serif;
width: 200px;
height: 200px;
margin: 60px auto;
background: white;
box-shadow: 0px 5px 5px #222, -5px 7px 0px 3px #726a57, -12px 13px 2px rgba(0, 0, 0, 0.2);
position: relative;
border-radius: 1px;
-moz-transform: rotate(-20deg);
-ms-transform: rotate(-20deg);
-webkit-transform: rotate(-20deg);
transform: rotate(-20deg);
}
.calendar:before {
content: '';
position: absolute;
border-left: 200px solid transparent;
border-bottom: 30px solid rgba(0, 0, 0, 0.1);
bottom: 0px;
}
.month {
width: 100%;
background: linear-gradient(to right, #a32929, #ff6666 75%);
background: -webkit-linear-gradient(left, #a32929, #ff6666 75%);
background: -moz-linear-gradient(left, #a32929, #ff6666 75%);
height: 40px;
color: white;
box-shadow: 0px 5px 5px #ddd;
position: relative;
}
.month:before {
content: '';
position: absolute;
width: 10px;
height: 10px;
left: 60px;
top: 5px;
border-radius: 50%;
background: #4d0000;
box-shadow: 60px 0px 0px #4d0000;
}
.month:after {
content: '';
position: absolute;
width: 7px;
height: 20px;
background: #555;
border-radius: 20% 20% 0 0;
left: 62px;
top: -12px;
box-shadow: 0px -2px 0px #777, -1px 0px 2px #777, 0px 3px 0px #4d0000, 60px 0px 0px #555, 60px -2px 0px #777;
}
.month .month-name {
padding-left: 10px;
font-size: 20px;
letter-spacing: 2px;
position: absolute;
bottom: 0;
text-transform: uppercase;
}
.number {
text-align: center;
margin-top: -25px;
font-size: 150px;
color: #2d2d2d;
font-weight: 700;
}
.two {
width: 150px;
height: 150px;
background: #222;
margin: 100px auto;
position: relative;
overflow: hidden;
border-radius: 10px;
}
.caltwo {
width: 200px;
margin: 100px auto 0 auto;
background: #222;
text-align: center;
color: #eaeaea;
position: relative;
font-family: "Lato",sans-serif;
text-transform: uppercase;
padding: 10px 0;
box-shadow: 2px 5px 2px rgba(0, 0, 0, 0.2);
}
.daytwo {
font-size: 25px;
letter-spacing: 7px;
font-weight: 300;
margin-bottom: -2px;
}
.monthtwo {
font-size: 16px;
font-weight: 400;
color: #cc0000;
letter-spacing: 5px;
word-spacing: 5px;
}
.clock {
width: 150px;
height: 30px;
background: #eaeaea;
margin: 0 auto;
line-height: 30px;
text-align: center;
box-shadow: 5px 5px 2px rgba(0, 0, 0, 0.2);
}
.time {
display: inline-block;
margin: 0;
padding: 0;
margin-right: -4px;
font-family: "Lato",sans-serif;
font-weight: 300;
color: #666;
letter-spacing: 5px;
}
.meter {
width: 300px;
position: relative;
margin: 80px auto;
padding-bottom: 5px;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.meter:before {
content: '';
position: absolute;
width: 1px;
height: 10px;
left: 150px;
top: 0px;
background: #aaa;
}
.meter:after {
content: "Visual Clock";
position: absolute;
top: -20px;
font-family: "Lato",sans-serif;
font-weight: 300;
text-transform: uppercase;
opacity: 0.3;
font-size: 12px;
letter-spacing: 5px;
color: white;
}
.timer {
margin: 5px 0;
}
.hours {
height: 10px;
background: #222;
border-bottom: 1px solid #333;
}
.minutes {
height: 5px;
width: 1px;
background: #eaeaea;
border-bottom: 1px solid #333;
}
.minutes:before {
position: absolute;
content: '';
left: 150px;
width: 1px;
height: 5px;
background: #333;
}
.seconds {
height: 2px;
width: 1px;
background: #990000;
}
</style>
Step 3 – Add JavaScript
We use some external JavaScript link to this code. No need to worry about this, copy and paste below code between <head></head> tag.
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
And also copy and paste below JavaScript code between <script></script> tag.
<script>
$(document).ready(function () {
var weekdays = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
];
var months = [
"January",
"Februray",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
setInterval(function () {
var d = new Date();
var day = d.getDay();
var day_name = weekdays[day];
var num = d.getDate();
var mo = d.getMonth();
var name = months[mo];
$(".month-name").html(name.substring(0, 3));
$(".number").html(num);
//$(".day").html(day_name);
$(".monthtwo").html(name + " " + num);
$(".daytwo").html(day_name);
var minute = d.getMinutes();
var hour = d.getHours();
var sec = d.getSeconds();
var secMinMeter = 300 / 60;
$(".hours").css("width", hour * 12.5 + "px");
if (hour < 10) {
$(".hour").html("0" + hour + ":");
} else if (hour > 12) {
hour = hour - 12;
if (hour < 10) {
$(".hour").html("0" + hour + ":");
}
} else {
$(".hour").html(hour + ":");
}
if (minute < 10) {
$(".min").html("0" + minute + ":");
$(".minutes").css("width", minute * 5 + "px");
} else {
$(".min").html(minute + ":");
$(".minutes").css("width", minute * 5 + "px");
}
if (sec < 10) {
$(".sec").html("0" + sec);
$(".seconds").css("width", sec * 5 + "px");
} else {
$(".sec").html(sec);
$(".seconds").css("width", sec * 5 + "px");
}
}, 1000);
});
</script>
At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want. Enjoy it.
Your Output

Video Tutorial
Please watch this video to better understand this tutorial and don’t forget to subscribe to our channel.
Help others to find out about this article on Social Media sites. If you have any doubt or any problem, don’t hesitate to contact us. Thereafter we will be able to help you and also make sure you bookmark our site on your browser.