All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fincatto.documentofiscal.transformers.DFZonedDateTimeTransformer Maven / Gradle / Ivy

There is a newer version: 4.0.75
Show newest version
package com.fincatto.documentofiscal.transformers;

import org.simpleframework.xml.transform.Transform;

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class DFZonedDateTimeTransformer implements Transform {
    
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[XXX]");
    
    @Override
    public ZonedDateTime read(final String data) {
        return ZonedDateTime.parse(data, DFZonedDateTimeTransformer.FORMATTER);
    }
    
    @Override
    public String write(final ZonedDateTime data) {
        return DFZonedDateTimeTransformer.FORMATTER.format(data);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy