Example usage for org.joda.time.format ISODateTimeFormat yearMonthDay

List of usage examples for org.joda.time.format ISODateTimeFormat yearMonthDay

Introduction

In this page you can find the example usage for org.joda.time.format ISODateTimeFormat yearMonthDay.

Prototype

public static DateTimeFormatter yearMonthDay() 

Source Link

Document

Returns a formatter for a four digit year, two digit month of year, and two digit day of month.

Usage

From source file:org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil.java

License:Educational Community License

public String getIsoDateWithLocalTime(Date dateToConvert) {
    DateTime dt = new DateTime(dateToConvert);
    DateTimeFormatter fmt = ISODateTimeFormat.yearMonthDay();
    DateTimeFormatter localFmt = fmt.withLocale(new ResourceLoader().getLocale());
    DateTimeFormatter fmtTime = DateTimeFormat.shortTime();
    DateTimeFormatter localFmtTime = fmtTime.withLocale(new ResourceLoader().getLocale());
    return dt.toString(localFmt) + " " + dt.toString(localFmtTime);
}