I found a regular clock with google, that shows the time of the user's system clock, so I thought it might be able to be tweaked to show the time where I am.
I live in the UK at the moment, so right now we're on UTC+1. But I travel around a fair bit, so I was wondering if i'd be able to have the time zone it is displaying coded in PHP, & therefore changeable from my php CMS?
Any help at all is welcome.
Here's the code I mentioned:
(from here - http://www.nippersoft.com/Script/htmlclock.htm)
Expand|Select|Wrap|Line Numbers
- <script language = "JavaScript">
- function tick() {
- var hours, minutes, seconds, ap;
- var intHours, intMinutes, intSeconds;
- var today;
- today = new Date();
- intHours = today.getHours();
- intMinutes = today.getMinutes();
- intSeconds = today.getSeconds();
- if (intHours == 0) {
- hours = "12:";
- ap = "Midnight";
- } else if (intHours < 12) {
- hours = intHours+":";
- ap = "a.m";
- } else if (intHours == 12) {
- hours = "12:";
- ap = "noon";
- } else {
- intHours = intHours - 12
- hours = intHours + ":";
- ap = "p.m.";
- }
- if (intMinutes < 10) {
- minutes = "0"+intMinutes+":";
- } else {
- minutes = intMinutes+":";
- }
- if (intSeconds < 10) {
- seconds = "0"+intSeconds+" ";
- } else {
- seconds = intSeconds+" ";
- }
- timeString = hours+minutes+seconds+ap;
- Clock.innerHTML = timeString;
- window.setTimeout("tick();", 100);
- }
- window.onload = tick;
- //--></SCRIPT>