import java.util.Calendar; public class MyDate { Calendar calendar = Calendar.getInstance(); public int Year; public int Month; public int Day; public MyDate(){ Year = calendar.get(Calendar.YEAR); Month = calendar.get(Calendar.MONTH); Day = calendar.get(Calendar.DAY_OF_MONTH); } }