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

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

Introduction

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

Prototype

public DateTimeFormatterFactory() 

Source Link

Document

Create a new DateTimeFormatterFactory instance.

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;
}