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

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

There is a newer version: 0.4.15
Show newest version
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