- Declare an instance of the Calendar.Builder class and apply the run() function to it:
val calendar = Calendar.Builder().run {
build()
}
- Add the desired properties to the builder:
val calendar = Calendar.Builder().run {
setCalendarType("iso8601")
setDate(2018, 1, 18)
setTimeZone(TimeZone.getTimeZone("GMT-8:00"))
build()
}
- Print the date from the calendar to the console:
val calendar = Calendar.Builder().run {
setCalendarType("iso8601")
setDate(2018, 1, 18)
setTimeZone(TimeZone.getTimeZone("GMT-8:00"))
build()
}
print(calendar.time)
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.