Today ,I want to pick up the android,so I write down a little demo,in the demo I most use the date,so I check some information,and read it down in case I will forget it.
Time time = new Time();
time.setToNow(); //It is very important,it's easy to be ignored.
then you can get the year,month,day& time
int year = time.year;
int month = time.month; //month is the current month -1,means month is the index of monthes。
int day=time.monthday;
textview.setText(year+“-”+month+"-"+day);