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

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

Introduction

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

Prototype

public static DateTimeFormatter forPattern(String pattern) 

Source Link

Document

Factory to create a formatter from a pattern string.

Usage

From source file:com.belatrix.legal.jiraintegrationservice.greenhopper.GreenHopperField.java

License:Open Source License

/**
 * Gets a date-time from the given object.
 *
 * @param dt Date-Time as a string// w  ww.  j a va  2 s  . com
 *
 * @return the date-time or null
 */
public static DateTime getDateTime(Object dt) {
    if (dt == null || ((String) dt).equals(NO_DATE)) {
        return null;
    }
    return DateTime.parse((String) dt, DateTimeFormat.forPattern(DATE_TIME_FORMAT));
}

From source file:com.benfante.jslideshare.DocumentParser.java

License:Apache License

private DocumentParser() {
    format = DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss zzz yyyy");
}

From source file:com.blackducksoftware.integration.hub.cli.SimpleScanService.java

License:Apache License

/**
 * This method can be overridden to provide a more appropriate directory name for the logs of a specific scan
 * execution./*from ww w  . j  av  a 2  s  .  c o  m*/
 */
public String getSpecificScanExecutionLogDirectory() {
    DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd_HH-mm-ss-SSS").withZoneUTC();
    String timeString = DateTime.now().withZone(DateTimeZone.UTC).toString(dateTimeFormatter);
    return timeString;
}

From source file:com.brandboat.loader.lib.FdcRunData.java

public FdcRunData(CountDownLatch latch, String connURL, String sql) throws SQLException {
    super(latch, connURL);
    this.conn = DriverManager.getConnection(connURL);
    this.stat = conn.prepareStatement(sql);
    this.startTime = new DateTime();
    this.endTime = new DateTime();
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    endTime = dtf.parseDateTime("2015-11-01 01:00:00");
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL1() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET1").setServerName("f12aofdcf01").setIsPrimary(true).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL2() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET1").setServerName("f12aofdcf02").setIsPrimary(false).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL3() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET2").setServerName("F12AOFDCF01").setIsPrimary(false).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL4() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET2").setServerName("F12AOFDCF02").setIsPrimary(true).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL5() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET3").setServerName("F12AOFDCF01").setIsPrimary(true).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}

From source file:com.brandboat.loader.lib.FileServerInfo.java

private String createUpsertSQL6() {
    DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd hh:mm:ss");
    DateTime startTime = dtf.parseDateTime("2015-09-01 01:00:00");
    final UpsertSQLBuilder sql = new UpsertSQLBuilder();
    return sql.setServerId("SET3").setServerName("F12AOFDCF02").setIsPrimary(false).setIsServerAlive(true)
            .setLoadDate(startTime).build();
}