Just use withDayOfMonth
, and lengthOfMonth()
:
LocalDate initial = LocalDate.of(2014, 2, 13);
LocalDate start = initial.withDayOfMonth(1);
LocalDate end = initial.withDayOfMonth(initial.getMonth().length(initial.isLeapYear()));
More Related Contents:
- Dates with no time or timezone component in Java/MySQL
- Unix epoch time to Java Date object
- Convert java.util.Date to what “java.time” type?
- Difference between year-of-era and week-based-year?
- How to check if a date Object equals yesterday?
- Convert between LocalDate and sql.Date [duplicate]
- Parsing string to local date doesn’t use desired century
- DateTimeFormatter month pattern letter “L” fails
- LocalDate to java.util.Date and vice versa simplest conversion? [duplicate]
- DateTimeParse Exception
- String to ZonedDateTime is changing format
- DateTimeFormatter Support for Single Digit Day of Month and Month of Year
- Java 8 LocalDate – How do I get all dates between two dates?
- Why can’t OffsetDateTime parse ‘2016-08-24T18:38:05.507+0000’ in Java 8
- specific date string format [duplicate]
- Hours and seconds are lost when storing a date in the database [closed]
- How to get the day from timezone in java [duplicate]
- How can I get the current date and time in UTC or GMT in Java?
- java DateTimeFormatterBuilder fails on testtime [duplicate]
- Java: Check the date format of current string is according to required format or not [duplicate]
- Java, Calculate the number of days between two dates [duplicate]
- Convert String to Calendar Object in Java
- Unit testing a class with a Java 8 Clock
- handling DATETIME values 0000-00-00 00:00:00 in JDBC
- What are the date formats available in SimpleDateFormat class?
- Why does Java’s Date.getYear() return 111 instead of 2011?
- How to sanity check a date in Java
- converting gregorian to hijri date
- java: how to mock Calendar.getInstance()?
- Get Daylight Saving Transition Dates For Time Zones in Java