public void getDate()
{
   String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
    Calendar cal = Calendar.getInstance();
    Date curDate = new Date(System.currentTimeMillis());
    cal.setTime(curDate);
    int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
    if (w < 0)
        w = 0;
    
    System.out.println("--------------"+weekDays[w]);
}

 

 

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-02-28
  • 2021-12-30
  • 2021-12-31
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2021-05-18
  • 2022-12-23
相关资源
相似解决方案