Fiddle: http://jsfiddle.net/bnsex/1/
I want to use 12 hour clock for this code...
$(document).ready(function() { setInterval( function() { var hours = n
Try with this:
hours = (hours < 12 ? hours : hours - 12).toString().replace(/^\d{1}$/, '0$&');
Edit: It could be shorter, based on Vulcan's answer:
hours = (hours % 12).toString().replace(/^\d{1}$/, '0$&');