This is a discussion on show clocks, one showing the current time, and another showing a time 12 hours behind within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone help me how can i show clocks, one showing the current time, and another showing a ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all... Can anyone help me how can i show clocks, one showing the current time, and another showing a time 12 hours behind. Thanks... |
| Sponsored Links |
| |||
| Hi all... <form> <input name="timenow" type="text" size="8"> <input name="timethen" type="text" size="8"> </form> <script language="JavaScript"> function padout(number) { return (number < 10) ? '0' + number : number; } function updateClocks() { now = new Date(); document.forms[0].timenow.value = padout(now.getHours()) + ':' + padout(now.getMinutes()) + ':' + padout(now.getSeconds()); now.setTime(now.getTime() - (1000*60*60*12)); document.forms[0].timethen.value = padout(now.getHours()) + ':' + padout(now.getMinutes()) + ':' + padout(now.getSeconds()); setTimeout('updateClocks()',500); } updateClocks(); </script> Thanks... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count down in seconds from the current time to the year 2000 | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 03-07-2008 02:56 AM |
| How do I show a customized message based on the time of day? | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 12-18-2007 05:50 AM |
| Can you show a simple code showing file dependency in cache in asp.net ? | oxygen | ASP and ASP.NET Programming | 1 | 07-26-2007 04:08 AM |
| Showing PHP source | jegan | PHP Programming | 1 | 07-24-2007 01:09 AM |
| How to run win app without showing it in task manager | Gopisoft | VB.NET Programming | 1 | 07-18-2007 01:36 AM |