Here you can find the source of toLocalDate(java.util.Date d)
public static LocalDate toLocalDate(java.util.Date d)
//package com.java2s; //License from project: Apache License import org.joda.time.DateTimeZone; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; public class Main { public static final DateTimeFormatter localDateFormatter = DateTimeFormat.forPattern("YYYYMMDD"); public static LocalDate toLocalDate(java.sql.Date d) { // TODO - confirm this conversion always works, esp. across timezones LocalDate ld = (d == null ? null : LocalDate.fromDateFields(d)); return ld; }//from w ww . jav a 2s. com public static LocalDate toLocalDate(java.util.Date d) { // TODO - confirm this conversion always works, esp. across timezones LocalDate ld = (d == null ? null : LocalDate.fromDateFields(d)); return ld; } public static LocalDate toLocalDate(String s) { // TODO - confirm this conversion always works, esp. across timezones LocalDate ld = (s == null ? null : localDateFormatter.withZone(DateTimeZone.UTC).parseDateTime(s).toLocalDate()); return ld; } }