How to convert Joda Localdate to Joda DateTime?

There are various methods on LocalDate for this, including:

  • LocalDate::toDateTimeAtCurrentTime()
  • LocalDate::toDateTimeAtStartOfDay()
  • LocalDate::toDateTime( LocalTime )
  • LocalDate::toDateTime( LocalTime , DateTimeZone )

You have to be explicit about what you want the time component to be in the resulting DateTime object, which is why DateTime‘s general-conversion constructor can’t do it.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)