java determine whether a date is the end of the month

package com.test;

 

import java.util.Calendar;

import java.util.Date;

 

public class test2 {

public static void main(String[] args) {

Calendar calendar = Calendar.getInstance();

Date date = new Date();

System.out.println("date:"+date);

calendar.setTime(date);

int getDay = calendar.get(Calendar.DAY_OF_MONTH);

if(getDay == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){

System.out.println("true:"+true);

}else{

System.out.println("false:"+false);

}

}

}

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324071287&siteId=291194637