I'm new to joda-time and I didn't find anywhere examples to do some simple things.
I want to make an object where to save a time value read from a table in a database (a java.sql.Time - e.g. "18:30:00") I don't care about time zone, so I think that I need LocalDate. But the problem is that I couldn't create a LocalDate object based on that Time object.
I tried with no success LocalDate.fromDateFields(), DateTimeParser.parseInto(), DateTimeParser.parseDateTime().
EDIT:
I should have used LocalTime.
These work:
java.sql.Time time = Time.valueOf("18:30:00");
LocalTime lt1 = LocalTime.fromDateFields(time);
LocalTime lt2 = new LocalTime(time);
org.joda.time.LocalDaterepresents a date,java.sql.Timerepresents a time. What meaningful conversion would you expect to get from that?YearMonthDayandTimeOfDaywere classes where you don't need all the datetime fields (partial). But when I wanted to use them, there were deprecated and it said useLocalDateandLocalTime. Now I see that I should have usedLocalTime. But it doesn't work with this neither.getMillisOfDay()would work, if you only need the time fields. They return ints because there are only 86,400,000 millis in a day.