how to get current time in html code example
Example 1: js nwe date today
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
document.write(today);
Example 2: current date in html
<!DOCTYPE html>
<html>
<head>
<title>Print</title>
</head>
<style>
box-shadow: 0 0 1in -0.25in rgba(0, 0, 0, 0.5);
background:
::selection {background:
::moz-selection {background:
h1{
color:
}
h2{}
h3{
font-weight: 300;
line-height: 2em;
}
p{
color:
line-height: 1.2em;
}
border-bottom: 1px solid
}
height: 60px;
width: 60px;
background: url(images.png) no-repeat;
background-size: 60px 60px;
}
.clientlogo{
height: 60px;
width: 60px;
background: url(images.jpg) no-repeat;
background-size: 60px 60px;
border-radius: 50px;
}
.info{
display: block;
//float:left;
margin-left: 0;
width: 30px;
}
.title{
float: right;
}
.title p{text-align: right;}
table{
width: 100%;
border-collapse: collapse;
}
td{
padding: 5px 0 5px 5px;
border: 1px solid
}
.tabletitle{
padding: 5px;
background:
}
.service{border-bottom: 1px solid
.item{width: 24mm;}
.itemtext{}
margin-top: 5mm;
}
}
</style>
<body>
<div class="logo" style="padding-left: 5%;">
<img src="images.jpg" style="width: 80px;">
</div>
<div class="info">
</div><!--End Info-->
<div id="mid">
<div class="info">
<h4 style="padding-left: 5%;">Token Number</h4><h1 style="padding-left: 7%;">01</h1>
<table>
<tr class="tabletitle">
<td class="item"><h3>Item</h3></td>
<td class="Hours"><h3>Qty</h3></td>
<td class="Rate"><h3>Sub Total</h3></td>
</tr>
<tr class="service">
<td class="tableitem"><p class="itemtext">Communication</p></td>
<td class="tableitem"><p class="itemtext">5</p></td>
<td class="tableitem"><p class="itemtext">$375.00</p></td>
</tr>
<tr class="service">
<td class="tableitem"><p class="itemtext">Asset Gathering</p></td>
<td class="tableitem"><p class="itemtext">3</p></td>
<td class="tableitem"><p class="itemtext">$225.00</p></td>
</tr>
<tr class="service">
<td class="tableitem"><p class="itemtext">Design Development</p></td>
<td class="tableitem"><p class="itemtext">5</p></td>
<td class="tableitem"><p class="itemtext">$375.00</p></td>
</tr>
<tr class="tabletitle"><td></td>
<td class="Rate"><h3>Total</h3></td>
<td class="payment"><h3>$3,644.25</h3></td>
<p style="padding-left: 14%; font-size: 100%;" id="date"></p>
</tr>
</table>
<small style="padding-left: 5%; font-size: 60%;" >@copyright by quicktech </small>
</div><!--End Table-->
</div><!--End InvoiceBot-->
</div><!--End Invoice-->
<script type="text/javascript">
n = new Date();
y = n.getFullYear();
m = n.getMonth() + 1;
d = n.getDate();
document.getElementById("date").innerHTML = m + "/" + d + "/" + y;
</script>
</body>
</html>