Example usage for com.fasterxml.jackson.databind.util ISO8601DateFormat format

List of usage examples for com.fasterxml.jackson.databind.util ISO8601DateFormat format

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.util ISO8601DateFormat format.

Prototype

public final String format(Date date) 

Source Link

Document

Formats a Date into a date-time string.

Usage

From source file:io.soabase.core.rest.SoaApis.java

@GET
@Produces(MediaType.APPLICATION_JSON)/*from  w  ww  . j  av  a 2 s  .c o  m*/
public Info getInfo() {
    TimeZone tz = TimeZone.getTimeZone("UTC");
    ISO8601DateFormat df = new ISO8601DateFormat();
    df.setTimeZone(tz);
    String now = df.format(new Date());
    String start = df.format(new Date(soaInfo.getStartTimeMs()));
    return new Info(soaInfo.getScopes(), soaInfo.getMainPort(), soaInfo.getAdminPort(),
            soaInfo.getServiceName(), soaInfo.getInstanceName(), start, now);
}