kingtommyboy
30 August 2006, 21:55
kan iemand deze actionscript eens nazien
het is voor een digitale klok
maar vanachter krijg ik niet pm of am en ik vind de fout niet
mvg
thomas
time = new Date(); //time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
appm = "AM";
}
else{
ampm = "PM";
}
while (hours>12){
hours = hours -12;
}
if (hours<10)
{
hours = "0" + hours;
}
if ( minutes<10)
{
minutes = "0" + minutes;
}
if (seconds<10)
{
seconds = "0" + seconds;
}
clock.text = hours + ":" + minutes + ":" + seconds + " " + ampm;
het is voor een digitale klok
maar vanachter krijg ik niet pm of am en ik vind de fout niet
mvg
thomas
time = new Date(); //time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
appm = "AM";
}
else{
ampm = "PM";
}
while (hours>12){
hours = hours -12;
}
if (hours<10)
{
hours = "0" + hours;
}
if ( minutes<10)
{
minutes = "0" + minutes;
}
if (seconds<10)
{
seconds = "0" + seconds;
}
clock.text = hours + ":" + minutes + ":" + seconds + " " + ampm;