Answer the question
In order to leave comments, you need to log in
How to make the correct date format?
I’m not friends with js at all, with grief in half I made a script to call the date and time:
$(function () {
zk.afterMount(function () {
function timerClock() {
var labelOne = document.getElementById('labelOne'),
labelTwo = document.getElementById('labelTwo');
window.isimple = window.isimple || {}
window.isimple.dates = window.isimple.dates || {}
window.isimple.dates.getCurrentDate = function () {
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth() + 1;
var curr_year = d.getFullYear();
return (curr_year + "." + curr_month + "." + curr_date);
}
labelOne.innerHTML = window.isimple.dates.getCurrentDate();
window.isimple.dates.getCurrentTime = function () {
var d = new Date();
var curr_hours = d.getHours();
var curr_minutes = d.getMinutes();
var curr_sec = d.getSeconds();
return (curr_hours + ":" + curr_minutes + ":" + curr_sec);
}
labelTwo.innerHTML = window.isimple.dates.getCurrentTime();
}
setInterval(timerClock, 1000);
timerClock()
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question