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

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

Introduction

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

Prototype

public void setIso(ISO iso) 

Source Link

Document

Set the ISO format used to format date values.

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