public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FORMAT
The date format without time.
|
static String |
ISO8601_FORMAT
The date format used by ISO8601.
|
static String |
NRQL_DATE_FORMAT
The date format used by NRQL queries.
|
Modifier and Type | Method and Description |
---|---|
static String |
getFormattedDate(long dt)
Returns the given date time formatted using the YYYY-MM-DD format.
|
static String |
getFormattedDate(long dt,
String format)
Returns the given date time formatted using the given format.
|
static String |
getFormattedDateTime(long dt,
String format)
Returns the given date time formatted using the given format.
|
static String |
getFormattedDateTime(long dt,
TimeZone tz,
String format)
Returns the given date time formatted using the given format and timezone.
|
static String |
getNrqlDateTime(long dt)
Returns the given date time formatted using the NRQL format.
|
static String |
getUtcDateTime(long dt)
Returns the given date time formatted using the ISO8601 format.
|
public static final String ISO8601_FORMAT
public static final String DATE_FORMAT
public static final String NRQL_DATE_FORMAT
public static String getFormattedDateTime(long dt, TimeZone tz, String format)
dt
- The date to format (in milliseconds)tz
- The timezone for the date (or null)format
- The format to use for the datepublic static String getFormattedDateTime(long dt, String format)
dt
- The date to format (in milliseconds)format
- The format to use for the datepublic static String getUtcDateTime(long dt)
dt
- The date to format (in milliseconds)public static String getFormattedDate(long dt, String format)
dt
- The date to format (in milliseconds)format
- The format to use for the datepublic static String getFormattedDate(long dt)
dt
- The date to format (in milliseconds)public static String getNrqlDateTime(long dt)
dt
- The date to format (in milliseconds)Copyright © 2018. All rights reserved.