Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ano = _root.ano;
- var mes = _root.mes;
- var dia = _root.dia;
- texto_txt.text = _root.texto;
- data1 = new Date(ano, mes-1, dia);
- data2 = new Date();
- difSeg = Math.floor((data1-data2)/1000);
- seg = difSeg%60;
- difMin = Math.floor(difSeg/60);
- minu = difMin%60;
- difHoras = Math.floor(difMin/60);
- horas = difHoras%24;
- dias = Math.floor(difHoras/24);
- 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 = ""+dias;} if (dias<10) {dias = ""+dias;} if (dias>999) {dias = "999";} // Void negative numbers
- display.text = dias+ "" +horas+ "" +minu+ "" +seg;
Add Comment
Please, Sign In to add comment