關於java日期的函數

public static SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");//這個可以自己定義

/**
  * yyyy-mm-dd
  * @param num
  * @return
  */
 public static String format_today()
 {
  Calendar c = Calendar.getInstance();
  return s.format(c.getTime());
 }
 /**
  * yyyymmdd
  * @return
  */
 public static String format_today_2()
 {
  SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
  Calendar c = Calendar.getInstance();
  return sim.format(c.getTime());
 }
 /**
  * yyyy-mm-dd
  * @param year_num
  * @return
  */
 public static String format_year_today(int year_num)
 {
  Calendar c = Calendar.getInstance();
  c.add(Calendar.YEAR,year_num);
  return s.format(c.getTime());
 }
 public static String format_year_today_2(int year_num)
 {
  SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
  Calendar c = Calendar.getInstance();
  c.add(Calendar.YEAR,year_num);
  return sim.format(c.getTime());
 }
 /**
  * yyyy-mm-dd
  * @param month_num
  * @return
  */
 public static String format_month_today(int month_num)
 {
  Calendar c = Calendar.getInstance();
  c.add(Calendar.MONTH,month_num);
  return s.format(c.getTime());
 }
 /**
  * yyyy-mm-dd
  * @param date_num
  * @return
  */
 public static String format_date_today(int date_num)
 {
  Calendar c = Calendar.getInstance();
  c.add(Calendar.DATE,date_num);
  return s.format(c.getTime());
 }
 /**
  * yyyy-mm-dd
  * @param year_num
  * @param month_num
  * @param date_num
  * @return
  */
 public static String format_all_today(int year_num,int month_num,int date_num)
 {
  Calendar c = Calendar.getInstance();
  c.add(Calendar.YEAR,year_num);
  c.add(Calendar.MONTH,month_num);
  c.add(Calendar.DATE,date_num);
  return s.format(c.getTime());
 }