Class DateUtils
- java.lang.Object
-
- cern.nxcals.api.backport.domain.util.DateUtils
-
public final class DateUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DATE_FORMAT_PATTERN
static java.util.TimeZone
LOCAL_TIMEZONE
static java.lang.String
TIMESTAMP_FORMAT_PATTERN
static java.util.TimeZone
UTC_TIMEZONE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
formatAsLocalDate(java.util.Date date)
static java.lang.String
formatAsLocalTime(java.sql.Timestamp time)
static java.lang.String
formatAsUTCDate(java.util.Date date)
static java.lang.String
formatAsUTCTime(java.sql.Timestamp time)
static java.lang.String
formatForInstrumentation(java.sql.Timestamp time)
static java.lang.String
formatTimestamp(java.sql.Timestamp timestamp, LoggingTimeZone timeZone)
static java.util.List<java.util.Date>
getDaylightSavingChanges(java.util.Date start, java.util.Date end)
static java.lang.String
getFormattedStamp(java.sql.Timestamp timestamp, LoggingTimeZone timeZone)
Returns a String formatted according to the given timestampstatic java.util.Calendar
newUTCCalendar()
-
-
-
Field Detail
-
DATE_FORMAT_PATTERN
public static final java.lang.String DATE_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
TIMESTAMP_FORMAT_PATTERN
public static final java.lang.String TIMESTAMP_FORMAT_PATTERN
- See Also:
- Constant Field Values
-
UTC_TIMEZONE
public static final java.util.TimeZone UTC_TIMEZONE
-
LOCAL_TIMEZONE
public static final java.util.TimeZone LOCAL_TIMEZONE
-
-
Method Detail
-
formatTimestamp
public static java.lang.String formatTimestamp(java.sql.Timestamp timestamp, LoggingTimeZone timeZone)
-
formatAsLocalDate
public static java.lang.String formatAsLocalDate(java.util.Date date)
-
formatAsLocalTime
public static java.lang.String formatAsLocalTime(java.sql.Timestamp time)
-
formatAsUTCDate
public static java.lang.String formatAsUTCDate(java.util.Date date)
-
formatAsUTCTime
public static java.lang.String formatAsUTCTime(java.sql.Timestamp time)
-
formatForInstrumentation
public static java.lang.String formatForInstrumentation(java.sql.Timestamp time)
-
getDaylightSavingChanges
public static java.util.List<java.util.Date> getDaylightSavingChanges(java.util.Date start, java.util.Date end)
-
getFormattedStamp
public static java.lang.String getFormattedStamp(java.sql.Timestamp timestamp, LoggingTimeZone timeZone)
Returns a String formatted according to the given timestamp- Parameters:
timestamp
-timeZone
-- Returns:
- A formatted string
-
newUTCCalendar
public static java.util.Calendar newUTCCalendar()
-
-