Flash Clock - How to change to 12H format

var date:Date=new Date();
var h=date.getHours()
var m=date.getMinutes()
var s=date.getSeconds()
var sign
	if (h<12) {
		sign ="AM"		
	}
	else {
		sign="PM"
	}
while (h>12) {
	h=h-12;
}
if (h<10) {
	h="0"+h;
}
if (m<10) {
	m="0"+m;
}
if (s<10) {
	s="0"+s;
}
	
txttime.text=h+":"+m+":"+s;
txtsign.text=sign

Nevermind.

Anyone?

While not ActionScript, the ideas here should help you translate (possibly even literally) for your own case: http://stackoverflow.com/questions/4898574/converting-24-hour-time-to-12-hour-time-w-am-pm-using-javascript

:slight_smile:

I had already figured it out, but thanks :slight_smile: