SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
Date startDate = datetime.parse(date.format(calendar.getTime()) + " 00:00:00");
calendar.add(Calendar.MONTH, 1);
calendar.add(Calendar.DAY_OF_MONTH, -1);
Date endDate = datetime.parse(date.format(calendar.getTime()) + " 23:59:59");
月开始时间/月结束时间
最新推荐文章于 2024-07-24 17:27:32 发布