Sitenize saat ekleyin
html bölümü:
<div class='time-frame'>
<div id='tarih-bolumu'></div>
<div id='saat-bolumu'></div>
</div>
css bölümü:
<style type="text/css">
.time-frame {
background-color: #027bb5;
color: #fff;
width: auto;
min-width: 160px;
font-family: Arial;
margin:0 auto;
display:table;
padding:10px 10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.time-frame > div {
width: 100%;
text-align: center;
}
#tarih-bolumu {
font-size: 18px;
color:#a9fff7;
}
#saat-bolumu {
font-size: 32px;
line-height: 30px;
margin-top:5px;
}
</style>
JQuery kodları:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script>
<script type="text/javascript">
$(window).load(function(){
$(document).ready(function() {
var interval = setInterval(function() {
var momentNow = moment();
$('#tarih-bolumu').html(momentNow.format('DD.MM.YYYY'));
$('#saat-bolumu').html(momentNow.format('hh:mm:ss'));
}, 100);
});
});
</script>