/*
实现了获取任意年的二月份天数
*/
public static String getDate(int year)
{
Calendar c = Calendar.getInstance();
c.set(year,2,1);
c.add(Calendar.DAY_OF_MONTH,-1);
int y = c.get(Calendar.DAY_OF_MONTH);
String Dates =year+ "年的二月份天数是...."+y;
return Dates;
}
/*
2,获取昨天的现在这个时刻。
c.add(Calenar.DAY_OF_MONTH,-1);
*/
public static String getTime()
{
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH,-1);
int YEAR =c.get(Calendar.YEAR);
int MONTH =c.get(Calendar.MONTH)+1;
int DATE=c.get(Calendar.DAY_OF_MONTH);
int WEEK=c.get(Calendar.DAY_OF_WEEK)+1;
int HOUR =c.get(Calendar.HOUR);
int MINUTE=c.get(Calendar.MINUTE);
int SECOND =c.get(Calendar.SECOND);