Top Description Fields Constructors Methods
org.eclipse.jetty.http

public Class DateGenerator

extends Object
Class Inheritance
Imports
java.time.Instant, java.util.Calendar, .GregorianCalendar, .TimeZone, org.eclipse.jetty.util.StringUtil

ThreadLocal Date formatters for HTTP style dates.

Field Summary

Modifier and TypeField and Description
public static final String
private static final ThreadLocal<DateGenerator>
private static final TimeZone
private final StringBuilder
pack-priv static final String[]
private final GregorianCalendar
pack-priv static final String[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
doFormatCookieDate(StringBuilder
the buffer to format the date into
buf
,
long
the date in milliseconds
date
)

Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies

public String

Returns:

the formatted date
doFormatDate
(long
the date in milliseconds
date
)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

public static String

Returns:

the formatted date
formatDate
(long
the date in milliseconds
date
)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

public static String

Returns:

the formatted date
formatDate
(Instant
the date/time instant
instant
)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__01Jan1970back to summary
public static final String __01Jan1970
__dateGeneratorback to summary
private static final ThreadLocal<DateGenerator> __dateGenerator
__GMTback to summary
private static final TimeZone __GMT
bufback to summary
private final StringBuilder buf
DAYSback to summary
pack-priv static final String[] DAYS
gcback to summary
private final GregorianCalendar gc
MONTHSback to summary
pack-priv static final String[] MONTHS

Constructor Detail

DateGeneratorback to summary
public DateGenerator()

Method Detail

doFormatCookieDateback to summary
public void doFormatCookieDate(StringBuilder buf, long date)

Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies

Parameters
buf:StringBuilder

the buffer to format the date into

date:long

the date in milliseconds

doFormatDateback to summary
public String doFormatDate(long date)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

Parameters
date:long

the date in milliseconds

Returns:String

the formatted date

formatDateback to summary
public static String formatDate(long date)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

Parameters
date:long

the date in milliseconds

Returns:String

the formatted date

formatDateback to summary
public static String formatDate(Instant instant)

Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"

Parameters
instant:Instant

the date/time instant

Returns:String

the formatted date