Example usage for org.springframework.format.datetime.joda DateTimeFormatterFactory createDateTimeFormatter

List of usage examples for org.springframework.format.datetime.joda DateTimeFormatterFactory createDateTimeFormatter

Introduction

In this page you can find the example usage for org.springframework.format.datetime.joda DateTimeFormatterFactory createDateTimeFormatter.

Prototype

public DateTimeFormatter createDateTimeFormatter() 

Source Link

Document

Create a new DateTimeFormatter using this factory.

Usage

From source file:com.infinitechaos.vpcviewer.config.JacksonConfiguration.java

@Bean
public JodaModule jacksonJodaModule() {
    JodaModule module = new JodaModule();
    DateTimeFormatterFactory formatterFactory = new DateTimeFormatterFactory();
    formatterFactory.setIso(DateTimeFormat.ISO.DATE);
    module.addSerializer(DateTime.class, new DateTimeSerializer(
            new JacksonJodaFormat(formatterFactory.createDateTimeFormatter().withZoneUTC())));
    return module;
}