Package org.eclipse.jetty.util
Class DateCache
- java.lang.Object
-
- org.eclipse.jetty.util.DateCache
-
@Deprecated(since="2021-05-27") public class DateCache extends java.lang.Object
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Date Format Cache. Computes String representations of Dates and caches the results so that subsequent requests within the same second will be fast. Only format strings that contain either "ss". Sub second formatting is not handled. The timezone of the date may be included as an ID with the "zzz" format string or as an offset with the "ZZZ" format string. If consecutive calls are frequently very different, then this may be a little slower than a normal DateFormat.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DateCache.Tick
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FORMAT
Deprecated.
-
Constructor Summary
Constructors Constructor Description DateCache()
Deprecated.Constructor.DateCache(java.lang.String format)
Deprecated.Constructor.DateCache(java.lang.String format, java.util.Locale l)
Deprecated.DateCache(java.lang.String format, java.util.Locale l, java.lang.String tz)
Deprecated.DateCache(java.lang.String format, java.util.Locale l, java.util.TimeZone tz)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
format(long inDate)
Deprecated.Format a date according to our stored formatter.java.lang.String
format(java.util.Date inDate)
Deprecated.Format a date according to our stored formatter.java.lang.String
formatNow(long now)
Deprecated.Format a date according to our stored formatter.java.lang.String
getFormatString()
Deprecated.java.util.TimeZone
getTimeZone()
Deprecated.java.lang.String
now()
Deprecated.DateCache.Tick
tick()
Deprecated.
-
-
-
Field Detail
-
DEFAULT_FORMAT
public static final java.lang.String DEFAULT_FORMAT
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DateCache
public DateCache()
Deprecated.Constructor. Make a DateCache that will use a default format. The default format generates the same results as Date.toString().
-
DateCache
public DateCache(java.lang.String format)
Deprecated.Constructor. Make a DateCache that will use the given format- Parameters:
format
- the format to use
-
DateCache
public DateCache(java.lang.String format, java.util.Locale l)
Deprecated.
-
DateCache
public DateCache(java.lang.String format, java.util.Locale l, java.lang.String tz)
Deprecated.
-
DateCache
public DateCache(java.lang.String format, java.util.Locale l, java.util.TimeZone tz)
Deprecated.
-
-
Method Detail
-
getTimeZone
public java.util.TimeZone getTimeZone()
Deprecated.
-
format
public java.lang.String format(java.util.Date inDate)
Deprecated.Format a date according to our stored formatter.- Parameters:
inDate
- the Date- Returns:
- Formatted date
-
format
public java.lang.String format(long inDate)
Deprecated.Format a date according to our stored formatter. If it happens to be in the same second as the last formatNow call, then the format is reused.- Parameters:
inDate
- the date in milliseconds since unix epoch- Returns:
- Formatted date
-
formatNow
public java.lang.String formatNow(long now)
Deprecated.Format a date according to our stored formatter. The passed time is expected to be close to the current time, so it is compared to the last value passed and if it is within the same second, the format is reused. Otherwise a new cached format is created.- Parameters:
now
- the milliseconds since unix epoch- Returns:
- Formatted date
-
now
public java.lang.String now()
Deprecated.
-
tick
public DateCache.Tick tick()
Deprecated.
-
getFormatString
public java.lang.String getFormatString()
Deprecated.
-
-