function getTime() {
var now = new Date();
var nnn = now.getHours();
//alert(nnn);
var hrs = 9-now.getHours();
var hh = now.setHours(hrs);
var hrs = 0+now.getHours();
if (hrs < 10) hrs = '0'+hrs;
var mins = 59-now.getMinutes();
if (mins < 10) mins = '0'+mins;
var secs = 59-now.getSeconds();
if (secs < 10) secs = '0'+secs;
var str = '';
// str = now.toString();
str += 'Time Left\n'+hrs+' : '+mins+' : '+secs;
return str;
};
var label1 = Titanium.UI.createLabel({ text:'', top:20, left: 20, right:20, bottom:20,
}); win.add(label1); var timer = setInterval(function() { label1.text = getTime(); }, 1000);