getWeekDay TimeUtil
作者:互联网
package me.zhengjie.common.utils; import java.util.Calendar; import java.util.Date; /** * @author jie * @date 2018-12-13 * * 日期工具 */ public class TimeUtil { public static String getWeekDay(){ String[] weekDays = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); int w = cal.get(Calendar.DAY_OF_WEEK) - 1; if (w < 0){ w = 0; } return weekDays[w]; } }
标签:java,String,weekDays,TimeUtil,getWeekDay,cal,Calendar 来源: https://www.cnblogs.com/tonggc1668/p/11218599.html