tools
卜夫
这个作者很懒,什么都没留下…
展开
-
日期工具类
/** * 判断当前日期是星期几 * * @param pTime 修要判断的时间 * @return dayForWeek 判断结果 * @Exception 发生异常 */private int dayForWeek(String pTime) throws Exception { DateFormat format = new SimpleDateFormat("yy...原创 2019-01-07 16:46:08 · 186 阅读 · 0 评论 -
获取距离当前月最近的前五个月和后七个月
public static List<Map<Integer,Integer>> getLast12Months() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) + 1); //要先+1,才能把本月的算进去</spa...原创 2019-01-03 11:25:15 · 640 阅读 · 0 评论 -
获取某年某月的月初和月末时间
private static Map<String,String> getMonthStartAndEnd(Integer year,Integer month){ SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATETIME_PATTERN_DATE); //获取前月的第一天 Calen...原创 2019-01-03 11:26:28 · 1376 阅读 · 0 评论