You are on page 1of 2

/**

* @(#)ahora.java
*
* ahora application
*
* @author
* @version 1.00 2011/4/30
*/
import java.util.*;
import java.text.*;

public class ahora {

public ahora () {

}
public static void main(String[] args) {

;

System.out.println("Hello World!");

int a = 0;
int c = 0;
long sg2 = 0;
long sg = 0;

while(a==0)
{
GregorianCalendar gc = new GregorianCalendar(); ////fecha actual
GregorianCalendar gc1 = new GregorianCalendar(2011, 04, 21, 5, 40 , 20); ////fec
ha final
Date fec1 = gc.getTime();
Date fec2 = gc1.getTime();
long time = fec2.getTime() - fec1.getTime();
sg = time/(1000);
long da =sg/(60*60*24);
long h= (sg-(da*60*60*24))/3600;
long m =(sg-((da*24*3600)+(h*3600)))/60;
long sgs = sg-(m*60+h*3600+da*24*3600);

System.out. System.out. } }.println(h + "\t horas"). System.println(""). System. System.out.out. System.println(da + " \t dias").if (sg != sg2){ System.out.out.println("").out.println(""). } } . System.out. sg2 = sg.println(m + "\t minutos").println(sgs + "\t segundos" ). System.out.println("cuenta regresiva").println("").