'Build org.joda.time.DateTime with java.time.LocalDate and java.time.LocalTime or java.time.LocalDateTime
So basically I have a DatePicker and TimePicker which will respectively give me a LocalDate and LocalTime. Now I want to use these values to make a org.joda.time.DateTime variable.
I'm not sure how to do that. I looked everywhere but I can't find a good answer to this all the answers I've found were for JPA which I'm not using.
Solution 1:[1]
As per official documentation https://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html you can use DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) Constructs an instance from datetime field values using ISOChronology in the default time zone. The values for the constructor can be obtained from LocalDate and Localtime object https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sj221 |
