I am working on a web based time clocking app and because the system time can be changed, it defeats the whole purpose. If I can get the app to display the internet time ( with a defined time zone) I think it would help.
I am using something like this already:
- Code: Select all
var isnMonths=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
var year=today.getYear();
if (year < 2000)
year = year + 1900;
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;
clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"p.m":"a.m";
And in the page I want it displayed, I use this:
- Code: Select all
<script language="JavaScript" type="text/javascript">
document.write("<B>"
+isnDays[today.getDay()]+", "+isnMonths[today.getMonth()]+" "
+today.getDate()+", "+ year + " "+clckh+":"+clckm+" "+clck+"</B>");
</script>
It will just display the system time.
Any suggestions would be appreciated.
Thanks.


