import java.util.Calendar;
import java.util.GregorianCalendar;


public class Birthdayish {

	public static void main(String[] args) {
		
		int ageInYears = 27; 
		
		String types[] = new String[]{ "by google", "sidereal" , "tropical", "anomalistic" };
		double secondsPerYear[] = new double[]{
				31556926l, //according to google [ http://www.google.co.uk/search?q=seconds+in+year ]
				365.256363004 * 86400.0, // sidereal year (relative to other stars) [http://en.wikipedia.org/wiki/Year]
				365.24219 * 86400.0, // tropical year (w.r.t to solar equinox) [http://en.wikipedia.org/wiki/Year]
				365.259636 * 86400.0 // anomalistic year (w.r.t to earth's apsides) [http://en.wikipedia.org/wiki/Year]
		};		
		
		GregorianCalendar birth = new GregorianCalendar(1984, 03, 26, 9, 30, 00);
		long mBirth = birth.getTimeInMillis();
		
		System.out.println("milisecs of birth since epoch = " + mBirth);
		
		for(int i=0; i < types.length; i++){
			GregorianCalendar birthday = new GregorianCalendar();
			birthday.setTimeInMillis((long) (mBirth + ageInYears * secondsPerYear[i] * 1000));
		
			System.out.println(types[i] + ":\t" + 
								birthday.get(Calendar.DATE) +"/" + 
								(birthday.get(Calendar.MONTH)+1) +"/" + 
								birthday.get(Calendar.YEAR) +" " + 	
								birthday.get(Calendar.HOUR_OF_DAY) + ":" +
								birthday.get(Calendar.MINUTE) + ":" +
								birthday.get(Calendar.SECOND)	);
			
		}
		 
	}
}
