Example usage for org.apache.commons.lang3.time DateFormatUtils format

List of usage examples for org.apache.commons.lang3.time DateFormatUtils format

Introduction

In this page you can find the example usage for org.apache.commons.lang3.time DateFormatUtils format.

Prototype

public static String format(final Calendar calendar, final String pattern) 

Source Link

Document

Formats a calendar into a specific pattern.

Usage

From source file:ubicrypt.ui.ctrl.ConfirmPKController.java

@Override
public void accept(final PGPPublicKey pgpPublicKey) {
    log.debug("received pk:{}", pgpPublicKey);
    creationDate.setText(DateFormatUtils.format(pgpPublicKey.getCreationTime(), "yyyy-MM-dd HH:mm"));
    algorithm.setText(PGPEC.algorithm(pgpPublicKey.getAlgorithm()));
    Utils.toStream(pgpPublicKey.getRawUserIDs()).forEach(userId -> userIds.getItems().add((String) userId));
    cancel.setOnMouseClicked(event -> anchor().popScene());
    add.setOnMouseClicked(event -> providerCommander.addOwnedPK(pgpPublicKey)
            .doOnError(err -> log.error(err.getMessage(), err))
            .doOnCompleted(() -> Platform.runLater(() -> navigator.browse("exportConfig"))).subscribe());
}

From source file:uk.gov.hscic.common.util.DateFormatter.java

public static String toString(final Date input) {
    if (input == null) {
        return null;
    }/*from   w  w  w. ja v  a2 s  . c om*/

    return DateFormatUtils.format(input, "yyyy-MM-dd'T'HH:mm:ss.SSSZ");
}

From source file:uk.gov.hscic.common.util.DateFormatter.java

public static String toJSONDateString(final Date input) {
    if (input == null) {
        return null;
    }/*w w w  .j av  a2s  . c om*/

    return DateFormatUtils.format(input, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
}

From source file:voltkvqa.AsyncBenchmark.java

public static String dateformat(long ctime) {
    return DateFormatUtils.format(ctime, "yyyy-MM-dd HH:mm:ss,SSS");
}

From source file:yoyo.actor.screen.iface.jsf.converter.DateConverter.java

@Override
public String getAsString(final FacesContext aContext, final UIComponent aUIComponent, final Object aObject) {
    if (aObject == null) {
        return null;
    }//from w w w  .  j  a v a  2  s.c om
    return DateFormatUtils.format((Date) aObject, FORMAL_PATTERN);
}