๋ฐ์ํ
๋น์ 1์ผ ๋ฐ ๋ง์ผ ๊ตฌํ๊ธฐ
- 1์ผ : firstDayOfMonth()
- ๋ง์ผ : lastDayOfMonth()
- 00:00:00 ๋ฐ 23:59:59๋ LocalTime.MIN ๋ฐ LocalTime.MAX ๋ฅผ ์ด์ฉํ๋ค
import static java.time.temporal.TemporalAdjusters.*
LocalDateTime today = LocalDateTime.now();
LocalDateTime starttime = today.with(firstDayOfMonth()).with(LocalTime.MIN); // ๋น์ 1์ผ 00:00:00
LocalDateTime endtime = today.with(lastDayOfMonth()).with(LocalTime.MAX); // ๋น์ ๋ง์ง๋ง๋ 23:59:59
Field Summary
FieldsModifier and TypeField and Description
static LocalTime | MAX
The maximum supported LocalTime, '23:59:59.999999999'.
|
static LocalTime | MIDNIGHT
The time of midnight at the start of the day, '00:00'.
|
static LocalTime | MIN
The minimum supported LocalTime, '00:00'.
|
static LocalTime | NOON
The time of noon in the middle of the day, '12:00'.
|
๐ Reference
๋ฐ์ํ