java实现日期转星期

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_42093488/article/details/82113253
public static void main(String args[]){

String[] weekDays = new String[]{"7", "1", "2", "3", "4", "5", "6"};

Calendar cal = Calendar.getInstance();

cal.setTime(new Date());

int w = cal.get(7) - 1;

System.out.print("weekDays="+weekDays[w]);

}

 

 

展开阅读全文

没有更多推荐了,返回首页