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  
Old 02-13-2008, 09:13 PM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 542
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
  #2  
Old 02-13-2008, 09:15 PM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 235
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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Greatest TV show of all time? likire The Lounge 2 06-24-2008 12:24 AM
Count down in seconds from the current time to the year 2000 itbarota HTML, CSS and Javascript Coding Techniques 1 03-07-2008 01: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 04: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 03:08 AM
Showing PHP source jegan PHP Programming 1 07-24-2007 12:09 AM


All times are GMT -7. The time now is 04:05 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0