Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ADD Countdown Timer of @4 Hours Wthi Update Of Label Every ! Sec

$
0
0

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);


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>