Volledige versie bekijken : actionscript probleem



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;

Icemar
30 August 2006, 21:59
time = new Date(); //time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "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;

je had appm staan inplaats van ampm

kingtommyboy
30 August 2006, 22:03
tnx
et werkt nu :D
hier mag al een slotje op ;)