Package io.wcm.caravan.pipeline.cache
Class CacheDateUtils
- java.lang.Object
-
- io.wcm.caravan.pipeline.cache.CacheDateUtils
-
@ProviderType public final class CacheDateUtils extends Object
some formatting/parsing functions for the date-format to be used in HTTP headers (see http://tools.ietf.org/html/rfc2616#section-3.3.1)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
formatCurrentTime()
static String
formatRelativeTime(int secondsRelativeToNow)
static int
getSecondsSince(String rfc1123Date)
static int
getSecondsUntil(String rfc1123Date)
static Date
parse(String rfc1123Date)
-
-
-
Method Detail
-
formatCurrentTime
public static String formatCurrentTime()
- Returns:
- the current date and time in RFC-1123 format (e.g. "Sun, 06 Nov 1994 08:49:37 GMT")
-
formatRelativeTime
public static String formatRelativeTime(int secondsRelativeToNow)
- Parameters:
secondsRelativeToNow
- offset to the current time (positive or negative!)- Returns:
- that time in RFC-1123 format (e.g. "Sun, 06 Nov 1994 08:49:37 GMT")
-
parse
public static Date parse(String rfc1123Date)
- Parameters:
rfc1123Date
- date and time in RFC-1123 format (e.g. "Sun, 06 Nov 1994 08:49:37 GMT")- Returns:
- the parsed date
-
getSecondsSince
public static int getSecondsSince(String rfc1123Date)
- Parameters:
rfc1123Date
- date and time in RFC-1123 format (e.g. "Sun, 06 Nov 1994 08:49:37 GMT")- Returns:
- the number of seconds that have passed since the given date
-
getSecondsUntil
public static int getSecondsUntil(String rfc1123Date)
- Parameters:
rfc1123Date
- date and time in RFC-1123 format (e.g. "Sun, 06 Nov 1994 08:49:37 GMT")- Returns:
- the number of seconds until the given date
-
-