<?xml version="1.0"?>
<rss version="2.0">
 <channel>
  <title>javascript clock | WPDFD.com Forums</title>
  <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/</link>
  <description>A Scripting forum thread at WPDFD.com</description>
  <language>en-us</language>
  <pubDate>02/03/04, 034 58 2004 2004:%i:1075813109 07:58:29</pubDate>
  <lastBuildDate>06/07/13, 158 19 2013 2013:%i:1370596752 05:19:12</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>NineLabs Framework Feed Generator</generator>
  <managingEditor>sitemaster@wpdfd.com</managingEditor>
  <webMaster>sitemaster@wpdfd.com</webMaster>
     <item>
    <title>Mmiv  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p367</link>
    <description><![CDATA[Hello to all!<br /><br />as you will see soon I’m giving the first steps in the world of web design.<br /><br />I’m sorry if the question is basic but I really need to learn how to do this.<br /><br />can somebody help me with this script:<br /><br />&lt;Script Language=&quot;javascript&quot;&gt;<br />&lt;!--<br /><br /> &nbsp; &nbsp; &nbsp;dt = new Date()<br /> &nbsp; &nbsp; &nbsp;var stemp;<br /> &nbsp; &nbsp; &nbsp;var stamp;<br /><br /> &nbsp; &nbsp; &nbsp;var dt_hour = dt.getUTCHours() ;<br /><br /> &nbsp; &nbsp; &nbsp;var dt_minute = dt.getUTCMinutes() ;<br /><br /> &nbsp; &nbsp; &nbsp;var dt_second = dt.getUTCSeconds() ;<br /><br /> &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp;<br /><br /> &nbsp; &nbsp; &nbsp;if (dt_minute &lt; 10)<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dt_minute = '0' + dt_minute ;<br /><br /> &nbsp; &nbsp; &nbsp;<br /><br /> &nbsp; &nbsp; &nbsp;if (dt_second &lt; 10)<br /><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dt_second = '0' + dt_second ;<br /> &nbsp; &nbsp; &nbsp;<br /><br /> &nbsp; &nbsp; &nbsp;stemp = dt_hour+ &quot;:&quot; + dt_minute + &quot;:&quot; + dt_second ;<br /> &nbsp; &nbsp;stamp =dt_hour + 7 + &quot;:&quot; + dt_minute + &quot;:&quot; + dt_second ;<br /> &nbsp; &nbsp; &nbsp;ste=dt_hour <br /> &nbsp; &nbsp; &nbsp;sta=dt_hour + 7<br /> &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp;if (sta &gt; 24)<br /> &nbsp; &nbsp; &nbsp;stamp= dt_hour - 17 + &quot;:&quot; + dt_minute + &quot;:&quot; + dt_second ;<br /><br /><br />document.write(&quot;&lt;center&gt;&quot;+&quot;&lt;b&gt;&quot;+&quot;&lt;font color=#0099CC size=2&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br /><br />if ((ste &gt; 7) &amp;&amp; (ste &lt;19))<br />document.write(&quot;&lt;img src='sol.gif'&gt;&quot;+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br />else<br />document.write(&quot;&lt;img src= 'lua.gif'&gt;&quot;+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br />document.write(&quot;Hora de Lisboa &nbsp;&quot;+stemp+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br /><br />if ((sta &gt; 7) &amp;&amp; (sta &lt;19))<br />document.write(&quot;&lt;img src= 'sol.gif'&gt;&quot;+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br />else<br />document.write(&quot;&lt;img src= 'lua.gif'&gt;&quot;+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br />document.write(&quot;Hora de Jacarta &nbsp;&quot;+stamp+&quot;&lt;br&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br />document.write(&quot;&lt;/center&gt;&quot;+&quot;&lt;/b&gt;&quot;+&quot;&lt;/font&gt;&quot<img src="/images/emoticons/wink.png" class="smiley" /><br /><br />//--&gt;<br />&lt;/script&gt;<br /><br />this script probably will shock some of you. I know... I know.. but as I told I’m giving the fist steps<br /><br />The question: the clocks doesn't move and i don't know where to use the setTimout()<br /><br />can some body help me please?<br /><br />Thanks<br />]]></description>
    <pubDate>02/03/04, 034 58 2004 2004:%i:1075813109 07:58:29</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p367</guid>
   </item>
     <item>
    <title>Joe Gillespie said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p368</link>
    <description><![CDATA[The problem with this script, even it did update, is that it would keep drawing the clocks down the page with every document.write.<br /><br />This script updates the time in a form text area.<br /><br /><br />&lt;script language=&quot;JavaScript&quot;&gt;<br /><br />&lt;!--<br />// please keep these lines on when you copy the source<br />// made by: Nicolas - http://www.javascript-page.com<br /><br />var clockID = 0;<br /><br />function UpdateClock() {<br /> &nbsp; if(clockID) {<br /> &nbsp; &nbsp; &nbsp;clearTimeout(clockID);<br /> &nbsp; &nbsp; &nbsp;clockID &nbsp;= 0;<br /> &nbsp; }<br /><br /> &nbsp; var tDate = new Date();<br /><br /> &nbsp; document.theClock.theTime.value = &quot;&quot; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + tDate.getHours() + &quot;:&quot; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + tDate.getMinutes() + &quot;:&quot; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + tDate.getSeconds();<br /> &nbsp; <br /> &nbsp; clockID = setTimeout(&quot;UpdateClock()&quot;, 1000);<br />}<br />function StartClock() {<br /> &nbsp; clockID = setTimeout(&quot;UpdateClock()&quot;, 500);<br />}<br /><br />function KillClock() {<br /> &nbsp; if(clockID) {<br /> &nbsp; &nbsp; &nbsp;clearTimeout(clockID);<br /> &nbsp; &nbsp; &nbsp;clockID &nbsp;= 0;<br /> &nbsp; }<br />}<br /><br />//--&gt;<br /><br />&lt;/script&gt;<br />&lt;body onload=&quot;StartClock()&quot; onunload=&quot;KillClock()&quot;&gt;<br />&lt;center&gt;&lt;form name=&quot;theClock&quot;&gt;<br />&lt;input type=text name=&quot;theTime&quot; size=8&gt;<br />&lt;form&gt;&lt;/center&gt;<br /><br />it wouldn't be too difficult to add another time zone.<br />]]></description>
    <pubDate>02/03/04, 034 32 2004 2004:%i:1075833133 13:32:13</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p368</guid>
   </item>
     <item>
    <title>Mmiv  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p369</link>
    <description><![CDATA[Thanks a million, I will try!<br /><br />By the way congratulations for this excellent page and forum<br /><br />this kinds of things make me a believer in the human race again. &nbsp;<img src="/images/emoticons/smile.png" class="smiley" /><br />]]></description>
    <pubDate>02/03/04, 034 08 2004 2004:%i:1075842526 16:08:46</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p369</guid>
   </item>
     <item>
    <title>Mmiv  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p370</link>
    <description><![CDATA[thanks again i solved my problem!]]></description>
    <pubDate>02/04/04, 035 20 2004 2004:%i:1075900849 08:20:49</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p370</guid>
   </item>
     <item>
    <title>Jdenny  said:</title>
    <link>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p371</link>
    <description><![CDATA[If you ever put a clock on a web page, then don't make it change every second - it would be very distracting. So take out the seconds, and also then you only need to update the clock each minute not every second...<br /><br />Instead work out the time left untill the current minute is up, then setTimeout() for that, at whcih point you update the clock text, and set a new time-out for 1 minute.]]></description>
    <pubDate>02/14/04, 045 04 2004 2004:%i:1076814287 22:04:47</pubDate>
    <guid>http://www.wpdfd.com/forums/wpdfd/scripting/javascript_clock/#p371</guid>
   </item>
   </channel>
</rss