<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Modifica orologio da formato americano ad europeo]]></title><description><![CDATA[<p dir="auto">Ciao a tutti,<br />
ho trovato questo script per realizzare un orologio. L'effetto è molto carino ma visualizza l'ora nel formato americano (e cioè con AM e PM). C'è modo di modificarlo e ottenere l'ora nel formato 24 hr?<br />
Grazie anticipate,<br />
Vicki</p>
<pre><code>&lt;script language="JavaScript1.1"&gt;
&lt;!--
// Setting variables
dig = new Image()
dig[0] = '0.gif'
dig[1] = '1.gif'
dig[2] = '2.gif'
dig[3] = '3.gif'
dig[4] = '4.gif'
dig[5] = '5.gif'
dig[6] = '6.gif'
dig[7] = '7.gif'
dig[8] = '8.gif'
dig[9] = '9.gif'
//writing images
document.write('&lt;table border=1 cellspacing=0 bgcolor="silver"&gt;')
document.write('&lt;tr&gt;&lt;td&gt;&lt;img src="0.gif" name="hrs1"&gt;&lt;/img&gt;')
document.write('&lt;img src="0.gif" name="hrs2"&gt;&lt;/img&gt;')
document.write('&lt;td&gt;&lt;img src="col.gif"&gt;&lt;/img&gt;')
document.write('&lt;td&gt;&lt;img src="0.gif" name="mins1"&gt;&lt;/img&gt;')
document.write('&lt;img src="0.gif" name="mins2"&gt;&lt;/img&gt;')
document.write('&lt;td&gt;&lt;img src="col.gif"&gt;&lt;/img&gt;')
document.write('&lt;td&gt;&lt;img src="0.gif" name="secs1"&gt;&lt;/img&gt;')
document.write('&lt;img src="0.gif" name="secs2"&gt;&lt;/img&gt;')
document.write('&lt;td&gt;&lt;img src="am.gif" name="ampm"&gt;&lt;/img&gt;&lt;/table&gt;')
//starting clock function
function showTime() {
now = new Date
ampmtime = now.getHours() - 12
thisHrs = '' + now.getHours() + ''
thisMin = '' + now.getMinutes() + ''
thisSec = '' + now.getSeconds() + ''
if (thisHrs &gt; 9) {
 if (thisHrs &gt;= 12) {
  document.ampm.src = 'pm.gif'
             if (thisHrs==12)
                    newHrs=''+12+''
  if (thisHrs &gt; 12) {
   newHrs = '' + ampmtime + ''
  }
  if (newHrs &lt;= 9) {
   document.hrs1.src = dig[0]
   document.hrs2.src = dig[newHrs.charAt(0)]
  }
  if (newHrs &gt; 9) {
   document.hrs1.src = dig[newHrs.charAt(0)]
   document.hrs2.src = dig[newHrs.charAt(1)]
  }
 }
 else {
  document.ampm.src = 'am.gif'
  document.hrs1.src = dig[thisHrs.charAt(0)]
  document.hrs2.src = dig[thisHrs.charAt(1)]
 }
}
if (thisHrs &lt;= 9) {
 document.ampm.src = 'am.gif'
 if (thisHrs == 0) {
  document.hrs1.src = dig[1]
  document.hrs2.src = dig[2]
 }
 else {
  document.hrs1.src = dig[0]
  document.hrs2.src = dig[thisHrs.charAt(0)]
 }
}
if (thisMin &gt; 9) {
 document.mins1.src = dig[thisMin.charAt(0)]
 document.mins2.src = dig[thisMin.charAt(1)]
}
if (thisMin &lt;= 9) {
 document.mins1.src = dig[0]
 document.mins2.src = dig[thisMin.charAt(0)]
}
if (thisSec &gt; 9) {
 document.secs1.src = dig[thisSec.charAt(0)]
 document.secs2.src = dig[thisSec.charAt(1)]
}
if (thisSec &lt;= 9) {
 document.secs1.src = dig[0]
 document.secs2.src = dig[thisSec.charAt(0)]
}
setTimeout("showTime()",1000)
}
window.onload=showTime
// --&gt;
&lt;/script&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/topic/106792/modifica-orologio-da-formato-americano-ad-europeo</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 09:18:51 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/106792.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Jul 2009 11:55:52 GMT</pubDate><ttl>60</ttl></channel></rss>