๋ฐ์ํ
Intro
์๋ ํ์ธ์. ์ด๋ฒ ์๊ฐ์๋ ์ฝํ๋ฆฐ์์ ์์์ผ๋ถํฐ ์ข ๋ฃ์ผ๊น์ง ํ๋ฃจ์ฉ ์ฆ๊ฐ์ํค๋ ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค.
How to do
datesUntil() ๋ฉ์๋์, plusDays() ๋ฉ์๋๋ฅผ ํ์ฉํ์ฌ ์์์ผ๋ถํฐ ์ข ๋ฃ์ผ๊น์ง 1์ฉ ์ฆ๊ฐ์์ผ์ค๋๋ค.
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
import java.time.LocalDate;
fun main() {
LocalDate.of(2023, 1, 14)
.datesUntil(LocalDate.of(2023, 1, 19).plusDays(1))
.forEach { it -> println(it) }
}
์ฝ๋ ์คํ ๊ฒฐ๊ณผ๋ ์๋์ ๊ฐ์ต๋๋ค.
2023-01-14
2023-01-15
2023-01-16
2023-01-17
2023-01-18
2023-01-19
๋ฐ์ํ