You must use LocalDatefor date and LocalTimefor time. These are the appropriate types for dates and times, respectively. You can get each one DateTimewith DateTime.toLocalDate()and DateTime.toLocalTime()if you need to use them as values DateTimeto get you started. Ideally, you would not have built DateTimeat all until you had two bits separately :)
Then you can LocalDate.toDateTime(LocalTime, DateTimeZone).
source
share