thing is it is reading the time from the local computer rather than the server. http://www.netrixnetwork.com/test/test.html <<can see it there.
Code:
Code: Select all
var now:Date = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
if (hours >= 12) {
ampm_txt.text = "PM";
} else {
ampm_txt.text = "AM";
}
if (hours > 12){
hours = hours - 12;
}
if (hours == 00){
hours = 12;
}
if (hours < 10){
hours_txt.text = "0" + hours;
} else {
hours_txt.text = hours;
}
if (minutes < 10){
minutes_txt.text = "0" + minutes;
} else {
minutes_txt.text = minutes;
}
if (seconds < 10){
seconds_txt.text = "0" + seconds;
} else {
seconds_txt.text = seconds;
}
fanx xx