How to do it...

  1. Declare an instance of the Calendar.Builder class and apply the run() function to it:
val calendar = Calendar.Builder().run {
build()
}
  1. 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()
}
  1. 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.
Reset
3.139.59.36