var now:Date = new Date();
var year = now.getFullYear();
var mouth = now.getMonth()+1;
var day = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes()+20;
var second = 0;
//到期時間
data1 = new Date(year, (mouth-1), day, hour, minute, second);
//現在時間
data2 = new Date();
difSeg = Math.floor((data1-data2)/1000);
//倒數秒數
seg = difSeg%60;
difMin = Math.floor(difSeg/60);
//倒數分數
minu = difMin%60;
//
//trace( data1);
////trace( data2);
if (seg<=0) {seg=0;} // Void negative numbers
if (minu<=0) {minu=0;} // Void negative numbers
if (horas<=0) {horas=0;} // Void negative numbers
if (dias<=0) {dias=0;} // Void negative numbers
if (seg<10) {seg = "0"+seg;}
if (minu<10) {minu = "0"+minu;}
if (horas<10) {horas = "0"+horas;}
if (dias<100) {dias = "0"+dias;} if (dias<10) {dias = "0"+dias;} if (dias>999) {dias = "999";} // Void negative numbers
//顯示倒數時間
display.text = dias+" "+horas+" "+minu+" "+seg;
留言列表