java 获取本月开始时间

public static String getMonthStart() {
        Calendar currentDate = Calendar.getInstance();
        currentDate.add(Calendar.MONTH, 0);
        currentDate.set(Calendar.DAY_OF_MONTH, 1);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        return dateFormat.format(currentDate.getTime());
}

你可能感兴趣的:(java,开发语言)