Calculate Convert Year To Day, Hour, Minutes, Seconds Using Java

  1. //convert year to day,hour,minutes,seconds  
  2.   
  3. import java.io.*;  
  4.   
  5. class ssva29  
  6. {  
  7.     public static void main(String arg[]) throws IOException  
  8.     {  
  9.         int yy;  
  10.         double dd,hr,min,sec;  
  11.         BufferedReader inp=new BufferedReader(new InputStreamReader(System.in));  
  12.         System.out.print("\n\nEnter the Year:  ");  
  13.         yy=Integer.parseInt(inp.readLine());  
  14.         // note:    to calculate for leap year        
  15.         dd=yy*365;  
  16.         hr=yy*(365*24);  
  17.         min=yy*(365*24*60);  
  18.         sec=yy*(365*24*60*60);  
  19.         System.out.println("\nDays:  "+dd+"\nHours:  " + hr+"\nMinutes:  "+min+ "\nSeconds:  " + sec);  
  20.     }  
  21.