IT Community - Software Programming, Web Development and Technical Support

show clocks, one showing the current time, and another showing a time 12 hours behind

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-13-2008, 10:13 PM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default show clocks, one showing the current time, and another showing a time 12 hours behind

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-13-2008, 10:15 PM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: show clocks, one showing the current time, and another showing a time 12 hours be

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 11:52 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0