Kotlin Date Conversion Library
This library can generate and convert data objects,
such as java.util.Date
, java.time.YearMonth
, java.time.LocalDate
, etc.
Here are some example.
-
When you want to create current
Date
object.DateTuner.createCurrentDate()
-
When you want to create current
YearMonth
object.DateTuner.createCurrentYearMonth()
-
When you want to create previous
YearMonth
object.// Last month DateTuner.createPreviousYearMonth() // The month before last month // You can put offset as an argument DateTuber.createPreviousYearMonth(2)
-
When you want to get month number from a
Date
orYearMonth
object, you can get it through the same method.DateTuner.getMonth(date) DateTuner.getMonth(yearMonth)
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation("com.github.KenjiOhtsuka:DateTuner:0.0.9")
}