I need to show a clock or digital time that displays the local Kauai, Hawaii time to users who will be accessing this page from places all over the world. I have seen world clock sites that have this information on their website but I am looking for a clock that I can move to my site so that they don't have to leave my site to see the Hawaii local time. Does anyone have any ideas on how to accomplish this? Thank you!
It's too bad nobody answered this. I'm sure there's some easy code out there that you could insert into your html page, like http://www.clocklink.com/ENG/gallery.htm I know that if you wanted, you could make a clock out of Flash using ActionScript. But then all your website viewers would need Flash player installed to see it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Any Title</title> <script type="text/javascript"> var GMToffset = -4; //Your CURRENT local offset, whether Daylight or Standard time. function dispClock(){ var PM = false; var refDate = new Date(); refDate.setHours(GMToffset+refDate.getHours()+refDate.getTimezoneOffset()/60); document.getElementById('localDay').innerHTML = refDate.toString().substring(0,3); document.getElementById('localDate').innerHTML = refDate.toString().substring(4,7)+" "+refDate.getDate()+" "+refDate.getFullYear(); var nHours = refDate.getHours().toString(); var nMins = refDate.getMinutes().toString(); if (nMins < 10){nMins = "0"+nMins} if (nHours > 12){nHours = nHours-12; PM=true} var timeStr = nHours+":"+nMins; if (PM){timeStr += " PM"} if (!PM && nHours != 12){timeStr += " AM"} if (!PM && nHours == 12){timeStr += " PM"} document.getElementById('localTime').innerHTML = timeStr; setTimeout("dispClock()",60000); } onload=dispClock; </script> </head> <body> <table border='1' align='center' cellspacing='0' cellpadding='5' style='font-size:14pt'> <thead> <tr> <th> Location </th> <th> Day </th> <th> Date </th> <th> Time </th> </tr> </thead> <tr> <td align='center'> Boston, MA </td> <td id='localDay' align='center'></td> <td id='localDate' align='center'></td> <td id='localTime' align='center'></td> </tr> </table> </body> </html> Code (markup):