Example usage for org.joda.time.format DateTimeFormat mediumDateTime

List of usage examples for org.joda.time.format DateTimeFormat mediumDateTime

Introduction

In this page you can find the example usage for org.joda.time.format DateTimeFormat mediumDateTime.

Prototype

public static DateTimeFormatter mediumDateTime() 

Source Link

Document

Creates a format that outputs a medium datetime format.

Usage

From source file:name.martingeisse.admin.application.converter.DateTimeConverter.java

License:Open Source License

/**
 * Obtains the formatter to use for the specified locale and current Wicket session.
 *//*from  ww w. j a  va2s .  c om*/
private static DateTimeFormatter getFormatter(Locale locale) {
    return DateTimeFormat.mediumDateTime().withLocale(locale).withZone(getTimeZone());
}

From source file:name.martingeisse.admin.application.converter.LocalDateTimeConverter.java

License:Open Source License

/**
 * Obtains the formatter to use for the specified locale.
 *///from  ww  w.  j av  a  2s  .c  o  m
private static DateTimeFormatter getFormatter(Locale locale) {
    return DateTimeFormat.mediumDateTime().withLocale(locale);
}

From source file:org.apache.isis.applib.fixturescripts.clock.ClockFixture.java

License:Apache License

private static LocalDate parseAsLocalDate(String dateStr) {
    for (DateTimeFormatter formatter : new DateTimeFormatter[] { DateTimeFormat.fullDateTime(),
            DateTimeFormat.mediumDateTime(), DateTimeFormat.shortDateTime(),
            DateTimeFormat.forPattern("yyyy-MM-dd"), DateTimeFormat.forPattern("yyyyMMdd"), }) {
        try {/* w  w  w.  jav a  2s  .com*/
            return formatter.parseLocalDate(dateStr);
        } catch (Exception e) {
            // continue;
        }
    }
    return null;
}

From source file:org.apache.isis.applib.fixturescripts.clock.ClockFixture.java

License:Apache License

private static LocalDateTime parseAsLocalDateTime(String dateStr) {
    for (DateTimeFormatter formatter : new DateTimeFormatter[] { DateTimeFormat.fullDateTime(),
            DateTimeFormat.mediumDateTime(), DateTimeFormat.shortDateTime(),
            DateTimeFormat.forPattern("yyyyMMddhhmmss"), DateTimeFormat.forPattern("yyyyMMddhhmm") }) {
        try {//from   w ww .  ja  va2 s.  c o m
            return formatter.parseLocalDateTime(dateStr);
        } catch (Exception e) {
            // continue;
        }
    }
    return null;
}

From source file:org.emonocot.harvest.media.ImageMetadataExtractorImpl.java

License:Open Source License

public ImageMetadataExtractorImpl() {

    dateTimeFormatters.add(ISODateTimeFormat.dateTimeParser());
    dateTimeFormatters.add(DateTimeFormat.fullDate());
    dateTimeFormatters.add(DateTimeFormat.fullDateTime());
    dateTimeFormatters.add(DateTimeFormat.shortDate());
    dateTimeFormatters.add(DateTimeFormat.shortDateTime());
    dateTimeFormatters.add(DateTimeFormat.mediumDate());
    dateTimeFormatters.add(DateTimeFormat.mediumDateTime());

}

From source file:org.nodel.reflection.Serialisation.java

License:Mozilla Public License

private static DateTime tryParseMediumDateTime(String value) {
    try {/* ww  w  .j av a  2  s .com*/
        return DateTime.parse(value, DateTimeFormat.mediumDateTime());
    } catch (Exception exc) {
        return null;
    }
}

From source file:org.ohmage.mobility.activity.ActivityRecognitionIntentService.java

License:Apache License

/**
 * Write the activity recognition update to the log file
 *
 * @param result The result extracted from the incoming Intent
 *//*from  w w  w  .j ava2  s  .c om*/
private void logActivityRecognitionResult(ActivityRecognitionResult result) {

    StringBuilder msg = new StringBuilder(DateTimeFormat.mediumDateTime().print(new LocalDateTime()));

    // Get all the probably activities from the updated result
    for (DetectedActivity detectedActivity : result.getProbableActivities()) {

        // Get the activity type, confidence level, and human-readable name
        int activityType = detectedActivity.getType();
        int confidence = detectedActivity.getConfidence();
        String activityName = getNameFromType(activityType);
        msg.append("|").append(activityName).append(": ").append(confidence);
    }

    ContentValues values = new ContentValues();
    values.put(MobilityContentProvider.ActivityPoint.DATA, msg.toString());
    getContentResolver().insert(MobilityContentProvider.ActivityPoint.CONTENT_URI, values);
}

From source file:org.ohmage.mobility.location.LocationListenerIntentService.java

License:Apache License

/**
 * Write the location update to the log file
 *
 * @param result The result extracted from the incoming Intent
 *//*  ww  w  .j a  va  2 s  .  c  o  m*/
private void logLocationResult(Location result) {

    StringBuilder msg = new StringBuilder(DateTimeFormat.mediumDateTime().print(new LocalDateTime()))
            .append("|");

    msg.append(result.getLatitude()).append(", ").append(result.getLongitude());

    ContentValues values = new ContentValues();
    values.put(MobilityContentProvider.LocationPoint.DATA, msg.toString());
    getContentResolver().insert(MobilityContentProvider.LocationPoint.CONTENT_URI, values);
}

From source file:org.openhat.opdi.units.UnitFormat.java

License:Open Source License

protected String formatUnixSecondsLocal(long value) {
    return DateTimeFormat.mediumDateTime().print(convertToLocalDate(value));
}

From source file:org.rhq.server.metrics.domain.MetricsIndexEntry.java

License:Open Source License

@Override
public String toString() {
    return "MetricsIndexEntry[bucket=" + bucket + ", scheduleId=" + scheduleId + ", time="
            + DateTimeFormat.mediumDateTime().print(time) + "]";
}