<script> var date = new Date(); document.write("<p>" + date.toString() + "</p>"); document.write("<p>" + date.toDateString() + "</p>"); document.write("<p>" + date.toTimeString() + "</p>"); </script>
Sat Apr 05 2025 16:41:08 GMT+0000 (Coordinated Universal Time)
Sat Apr 05 2025
16:41:08 GMT+0000 (Coordinated Universal Time)
<script> document.write("<p>Różnica między czasem UTC i czasem lokalnym w minutach: " + date.getTimezoneOffset() + "</p>"); </script>
Różnica między czasem UTC i czasem lokalnym w minutach: 0
<script> document.write("<p>" + date.toUTCString() + "</p>"); document.write("<p>" + date.toISOString() + "</p>"); </script>
Sat, 05 Apr 2025 16:41:08 GMT
2025-04-05T16:41:08.712Z
<script> document.write("<p>" + date.toLocaleString() + "</p>"); document.write("<p>" + date.toLocaleDateString() + "</p>"); document.write("<p>" + date.toLocaleTimeString() + "</p>"); </script>
4/5/2025, 4:41:08 PM
4/5/2025
4:41:08 PM
<script> var today = date.getDate() + "." + date.getMonth() + "." + date.getFullYear(); document.write("<p>" + today + "</p>"); </script>
5.3.2025
<script> var add0 = x => x < 10 ? "0" + x : x; var time = date.getHours() + ":" + add0(date.getMinutes()) + ":" + add0(date.getSeconds()); document.write("<p>" + time + "</p>"); </script>
16:41:08
<script> var time = date.getUTCHours() + ":" + add0(date.getUTCMinutes()) + ":" + add0(date.getUTCSeconds()); document.write("<p>" + time + "</p>"); </script>
16:41:08
<script> var date2 = new Date(); date2.setDate(7); date2.setMonth(2); date2.setFullYear(1975); document.write("<p>" + date2 + "</p>"); </script>
Fri Mar 07 1975 16:41:08 GMT+0000 (Coordinated Universal Time)
<script> var dni = ["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"]; document.write("<p>Dzień tygodnia: " + dni[date.getDay()] + "</p>"); </script>
Dzień tygodnia: Sobota
<script> var days = ["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"]; var months = ["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec", "Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"]; var data = days[date.getDay()] + " " + date.getDate() + ", " + months[date.getMonth()] + " " + date.getFullYear(); document.write("<p>" + data + "</p>"); </script>
Sobota 5, Kwiecień 2025
<body onload="start()" onunload="stop()"> <script> var interval = null; function start() { interval = setInterval(setTime, 1000); } function stop() { clearInterval(interval); } function setTime() { var date = new Date(); var add0 = x => x < 10 ? "0" + x : x; var time = date.getHours() + ":" + add0(date.getMinutes()) + ":" + add0(date.getSeconds()); document.getElementById("clock").value = time; } </script> <input type="text" id="clock" size="10">