Here you can find the source of toJavaDate(DateMidnight dm)
public static java.util.Date toJavaDate(DateMidnight dm)
//package com.java2s; //License from project: Apache License import org.joda.time.DateMidnight; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; public class Main { public static java.util.Date toJavaDate(DateMidnight dm) { // TODO - confirm this conversion always works, esp. across timezones java.util.Date d = (dm == null ? null : new java.util.Date(dm.getMillis())); return d; }// w ww .j a va2 s.c o m public static java.util.Date toJavaDate(DateTime dt) { // TODO - confirm this conversion always works, esp. across timezones java.util.Date ts = (dt == null ? null : new java.util.Date(dt.getMillis())); return ts; } public static java.util.Date toJavaDate(LocalDate ld) { // TODO - confirm this conversion always works, esp. across timezones java.util.Date d = (ld == null ? null : new java.util.Date(ld.toDateTimeAtStartOfDay().getMillis())); return d; } public static java.util.Date toJavaDate(LocalDateTime ldt) { // TODO - confirm this conversion always works, esp. across timezones java.util.Date d = (ldt == null ? null : new java.util.Date(ldt.toDateTime().getMillis())); return d; } public static DateTime toDateTime(java.sql.Timestamp ts) { // TODO - confirm this conversion always works, esp. across timezones DateTime dt = (ts == null ? null : new DateTime(ts)); return dt; } public static DateTime toDateTime(java.util.Date d) { // TODO - confirm this conversion always works, esp. across timezones DateTime dt = (d == null ? null : new DateTime(d)); return dt; } public static DateTime toDateTime(java.sql.Timestamp ts, String timeZoneID) { // TODO - confirm this conversion always works, esp. across timezones DateTime dt = (ts == null ? null : new DateTime(ts, DateTimeZone.forID(timeZoneID))); return dt; } public static DateTime toDateTime(java.util.Date d, String timeZoneID) { // TODO - confirm this conversion always works, esp. across timezones DateTime dt = (d == null ? null : new DateTime(d, DateTimeZone.forID(timeZoneID))); return dt; } }