Calendar cal = Calendar.getInstance();//初始化
SimpleDateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.CHINA); //设置显示格式,地区
Date currentTime = new Date(); String dateString = formatter.format(currentTime); //取得今天时间
int year = cal.get(Calendar.YEAR);//取得年
int mouth = cal.get(Calendar.MONTH) + 1;//取得月
int week = cal.get(Calendar.WEEK_OF_MONTH); //取得周
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK)//取得每周的第几天
int dayOfMouth = cal.get(Calendar.DAY_OF_MOUTH)//取得每周的第几天