package work;
public class two {
public static void main(String[] args) {
String date = "";
int totalDay = 0;
long totalMilliseconds = System.currentTimeMillis();
totalDay = (int)((totalMilliseconds / 1000 / 60 / 60 + 8) / 24 );
int year = 0;
int month = 0;
int day = 0;
for ( year = 1970; totalDay <= 366 ; year++) {
if (year % 4 == 0)
totalDay = totalDay - 366;
else
totalDay = totalDay - 365;
}
int[] monthDay = new int[12];
monthDay[0] = 31;
monthDay[2] = 31;
monthDay[3] = 30;
monthDay[4] = 31;
monthDay[5] = 30;
monthDay[6] = 31;
monthDay[7] = 31;
monthDay[8] = 30;
monthDay[9] = 31;
monthDay[10] = 30;
monthDay[11] = 31;
if (year % 4 != 0 )
monthDay[1] = 28;
else
monthDay[1] = 29;
for (month = 1; totalDay >= 0; month++) {
if (totalDay <= monthDay[month-1]) {
day = totalDay;
}
totalDay -= monthDay[month-1];
}
String yearz = Integer.toString(year);
String monthz = Integer.toString(month);
String dayz = Integer.toString(day);
date =yearz + " " + monthz + " " + dayz;
System.out.println(date);
}