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

infobip.api.config.FormattedDate Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version
package infobip.api.config;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author: pducic
 * Since: 21/10/15
 */
public class FormattedDate {
    private static final ThreadLocal DF = new ThreadLocal() {
        @Override
        public DateFormat initialValue() {
            return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
        }
    };

    private final Date date;

    public FormattedDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return DF.get().format(date);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy