Learn From:http://blog.csdn.net/sunhuwh/article/details/39161323 public class CalendarTest { public static void main(String[] args) { // 获取当前年份.月份.日期 Calendar cale = null; cale = Calendar.getInstance(); int year = cale.get(Calendar.YEAR); int month =
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package datetest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.
public String getMonday(String date) { if (date == null || date.equals("")) { System.out.println("date is null or empty"); return "0000-00-00 00:00:00"; } SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd")