• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

91
Views
Refreshing the clock on the page

I created a clock in Javascript, but I would like it to refresh automatically. I added a line: setInterval (data_czas, 1000); but if I gave it, the clock was automatically refreshed, but everything on my side disappeared and the clock itself was left, where every now and then there was a line with a new, refreshed date. Please help.

> <script>
function data_czas() {
    var miesiace = ["Stycznia","Lutego","Marca","Kwietnia","Maja","Czerwca","Lipca","Sierpnia","Września","Października","Listopada","Grudnia"];
    var dni = ["Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"];
    var data = new Date();
    var rok = data.getFullYear();
    var miesiac = data.getMonth();
    var tydzien = data.getDate();
    var dzien = data.getDay();
    var godzina = data.getHours();
    var minuta = data.getMinutes();
    var sekunda = data.getSeconds();
    if (minuta < 10) {
    minuta = "0" + minuta;
    }
    if (sekunda < 10) {
    sekunda = "0" + sekunda;
    }
    var p_data_czas = dni[dzien] + ", " + tydzien + " " + miesiace[miesiac] + " " + rok + " roku <br>" + "Godzina: " + godzina + ":" + minuta + ":" + sekunda
    document.write(p_data_czas);
    }
    document.write("<b> Dzisiaj jest: <Br>");
    data_czas();
    document.write("</b>")
</script>
</b>
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error