Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clock Time Issue

Status
Not open for further replies.

PcolaSteve

Programmer
Jul 1, 2011
30
US
This may not be the right forum and I apologize in advance for this. Perhaps someone has heard of this issue or can point me in the right direction.

I have a site with a time/date script. It shows correctly, (I am in the U.S., CDT zone,) with one exception. When I test it on my PDA the time and date showing is exactly 5 hours ahead of what it should be. I checked my PDA's time and settings and they are all set correctly and the time is correct but when I go to the site it still shows 5 hours later. I checked with my carrier and they have no clue either. Any clues?

The shortest distance between two points is NOT a straight line; it's through a worm hole!
 


Sounds like your script is using UTC rather than local time...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Ok, that makes sense except on all of the machines I have tried it out on it shows the correct date/time. Only on my PDA does it show incorrectly. I double checked the settings on my PDA and it is set to the correct time zone, so I am stuck. Here is my code for the time script.

<script type="text/javascript"> //script for time function

function updateClock(){
var currentTime = new Date();
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
var currentSeconds = currentTime.getSeconds();

currentMinutes = ( currentMinutes < 10 ? "0" : "") + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "") + currentSeconds;

var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
currentHours = ( currentHours > 12 ) ? currentHours -12 : currentHours;
currentHours = ( currentHours == 0 ) ? 12: currentHours;
var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}
</script>



The shortest distance between two points is NOT a straight line; it's through a worm hole!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top