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

org.webbitserver.helpers.DateHelper Maven / Gradle / Ivy

package org.webbitserver.helpers;

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

public class DateHelper {
    private static final ThreadLocal RFC_1123 = new ThreadLocal() {
        @Override
        protected DateFormat initialValue() {
            return new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
        }
    };

    public static String rfc1123Format(Date date) {
        return RFC_1123.get().format(date);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy