public final class DateTools extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ALT_ZVI |
static long |
ALT_ZVI_EPOCH |
static int |
COBOL |
static long |
COBOL_EPOCH |
static String |
ISO8601_FORMAT
ISO 8601 date format string.
|
static int |
MICROSOFT |
static long |
MICROSOFT_EPOCH |
static int |
UNIX
Timestamp formats.
|
static long |
UNIX_EPOCH
Milliseconds until UNIX epoch.
|
static int |
ZVI |
static long |
ZVI_EPOCH |
Modifier and Type | Method and Description |
---|---|
static String |
convertDate(long stamp,
int format)
Converts the given timestamp into an ISO8601 date.
|
static String |
convertDate(long stamp,
int format,
String outputFormat)
Converts the given timestamp into a date string with the given format.
|
static String |
convertDate(long stamp,
int format,
String outputFormat,
boolean correctTimeZoneForGMT)
Converts the given timestamp into a date string with the given format.
|
static String |
formatDate(String date,
String format)
Formats the given date as an ISO 8601 date.
|
static String |
formatDate(String date,
String[] formats)
Formats the given date as an ISO 8601 date.
|
static String |
formatDate(String date,
String[] formats,
boolean lenient)
Formats the given date as an ISO 8601 date.
|
static String |
formatDate(String date,
String format,
boolean lenient)
Formats the given date as an ISO 8601 date.
|
static long |
getMillisFromTicks(long hi,
long lo)
Converts from two-word tick representation to milliseconds.
|
static long |
getTime(String date,
String format)
Converts a string date in the given format to a long timestamp
(in Unix format: milliseconds since January 1, 1970).
|
public static final int UNIX
public static final int COBOL
public static final int MICROSOFT
public static final int ZVI
public static final int ALT_ZVI
public static final long UNIX_EPOCH
public static final long COBOL_EPOCH
public static final long MICROSOFT_EPOCH
public static final long ZVI_EPOCH
public static final long ALT_ZVI_EPOCH
public static final String ISO8601_FORMAT
public static long getMillisFromTicks(long hi, long lo)
public static String convertDate(long stamp, int format)
public static String convertDate(long stamp, int format, String outputFormat)
public static String convertDate(long stamp, int format, String outputFormat, boolean correctTimeZoneForGMT)
public static String formatDate(String date, String format)
formatDate(String, String, boolean)
, with the
'lenient' flag set to false.date
- The date to format as ISO 8601.format
- The date's input format.public static String formatDate(String date, String format, boolean lenient)
date
- The date to format as ISO 8601.format
- The date's input format.lenient
- Whether or not to leniently parse the date.public static String formatDate(String date, String[] formats)
formatDate(String, String[], boolean)
, with the
'lenient' flag set to false.date
- The date to format as ISO 8601.formats
- The date's possible input formats.public static String formatDate(String date, String[] formats, boolean lenient)
date
- The date to format as ISO 8601.formats
- The date's possible input formats.lenient
- Whether or not to leniently parse the date.Copyright © 2014 Open Microscopy Environment