org.webbitserver.helpers.DateHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webbit Show documentation
Show all versions of webbit Show documentation
A Java event based WebSocket and HTTP server
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);
}
}