@ApiStatus.Internal
public final class DateUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Date |
getCurrentDateTime()
Get the current date and time as ISO UTC
|
static java.util.Date |
getDateTime(java.util.Date date)
Converts the given Date and time to UTC timezone
|
static java.util.Date |
getDateTime(java.lang.String timestamp)
Get Java Date from UTC timestamp format
|
static java.util.Date |
getDateTimeWithMillisPrecision(java.lang.String timestamp)
Get Java Date from millis timestamp format
|
static java.lang.String |
getTimestamp(java.util.Date date)
Get date formatted as expected by Sentry.
|
static java.lang.String |
getTimestampIsoFormat(java.util.Date date)
Get date formatted as expected by Sentry.
|
public static java.lang.String getTimestampIsoFormat(java.util.Date date)
date
- the current date with local timezonepublic static java.util.Date getCurrentDateTime()
public static java.util.Date getDateTime(java.lang.String timestamp) throws java.lang.IllegalArgumentException
timestamp
- UTC format eg 2000-12-31T23:59:58Z or 2000-12-31T23:59:58.123Zjava.lang.IllegalArgumentException
public static java.util.Date getDateTimeWithMillisPrecision(java.lang.String timestamp) throws java.lang.IllegalArgumentException
timestamp
- millis format eg 1581410911.988 (1581410911 seconds and 988 millis)java.lang.IllegalArgumentException
public static java.lang.String getTimestamp(java.util.Date date)
date
- already UTC formatpublic static java.util.Date getDateTime(java.util.Date date)
date
- the Date with local timezone