public static String dayForWeek(String pTime) throws Throwable {  
	        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");  
	        Date tmpDate = format.parse(pTime);  
	        Calendar cal = Calendar.getInstance(); 
	        String[] weekDays = { "日", "一", "二", "三", "四", "五", "六" };
	        try {
	            cal.setTime(tmpDate);
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        int w = cal.get(Calendar.DAY_OF_WEEK) - 1; // 指示一个星期中的某天。
	        if (w < 0)
	            w = 0;
	        return weekDays[w];

	    }  

  传入日期

public static void main(String[] args) throws Throwable {

		 String a = dayForWeek("2019-06-29 09:44:1");

}	

  

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2021-11-28
  • 2021-09-09
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2022-01-01
  • 2021-07-02
  • 2022-01-18
相关资源
相似解决方案