Here you can find the source of parseAsDateTime(String date)
public static DateTime parseAsDateTime(String date)
//package com.java2s; //License from project: Apache License import org.joda.time.DateTime; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String DATE_FORMAT = "yyyy-MM-dd"; public static DateTime parseAsDateTime(String date) { return new DateTime(parseDate(date)); }//from w w w . j a v a 2 s.c o m public static Date parseDate(String date) { return parseDate(date, DATE_FORMAT); } public static Date parseDate(String dateString, String dateFormat) { try { return new SimpleDateFormat(dateFormat).parse(dateString); } catch (Exception e) { return null; } } }