Class DateTime
java.lang.Object
com.espertech.esper.common.client.util.DateTime
Utility class for date-time functions.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Calendar
parseDefaultCal
(String dateTime) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.static Date
parseDefaultDate
(String dateTime) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.static LocalDateTime
parseDefaultLocalDateTime
(String dateTime) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.static long
parseDefaultMSec
(String dateTime) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.static long
parseDefaultMSecWZone
(String dateTimeWithZone) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT_WITH_ZONE
.static ZonedDateTime
parseDefaultZonedDateTime
(String dateTime) Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
assume System default time zonestatic String
Print the provided date object using the default date formatDEFAULT_XMLLIKE_DATE_FORMAT
static String
printWithZone
(Object date) Print the provided date object using the default date formatDEFAULT_XMLLIKE_DATE_FORMAT
static Calendar
toCalendar
(String datestring) Returns a calendar from a given string using the default SimpleDateFormat for parsing.static Calendar
toCalendar
(String datestring, String format) Returns a calendar from a given string using the provided format.static Date
Returns a date from a given string using the default SimpleDateFormat for parsing.static Date
Returns a date from a given string using the provided format.static Long
toMillisec
(String datestring) Returns a long-millisecond value from a given string using the default SimpleDateFormat for parsing.static Long
toMillisec
(String datestring, String format) Returns a long-millisecond value from a given string using the provided format.
-
Field Details
-
DEFAULT_XMLLIKE_DATE_FORMAT
The default date-time format.- See Also:
-
DEFAULT_XMLLIKE_DATE_FORMAT_WITH_ZONE
The default date-time format with time zone.- See Also:
-
-
Constructor Details
-
DateTime
public DateTime()
-
-
Method Details
-
toCalendar
Returns a calendar from a given string using the default SimpleDateFormat for parsing.- Parameters:
datestring
- to parse- Returns:
- calendar
-
toCalendar
Returns a calendar from a given string using the provided format.- Parameters:
datestring
- to parseformat
- to use for parsing- Returns:
- calendar
-
toDate
Returns a date from a given string using the default SimpleDateFormat for parsing.- Parameters:
datestring
- to parse- Returns:
- date object
-
toDate
Returns a date from a given string using the provided format.- Parameters:
datestring
- to parseformat
- to use for parsing- Returns:
- date object
-
toMillisec
Returns a long-millisecond value from a given string using the default SimpleDateFormat for parsing.- Parameters:
datestring
- to parse- Returns:
- long msec
-
toMillisec
Returns a long-millisecond value from a given string using the provided format.- Parameters:
datestring
- to parseformat
- to use for parsing- Returns:
- long msec
-
print
Print the provided date object using the default date formatDEFAULT_XMLLIKE_DATE_FORMAT
- Parameters:
date
- should be long, Date or Calendar- Returns:
- date string
-
printWithZone
Print the provided date object using the default date formatDEFAULT_XMLLIKE_DATE_FORMAT
- Parameters:
date
- should be long, Date or Calendar- Returns:
- date string
-
parseDefaultMSec
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.- Parameters:
dateTime
- date-time string- Returns:
- milliseconds
-
parseDefaultLocalDateTime
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.- Parameters:
dateTime
- date-time string- Returns:
- LocalDateTime
-
parseDefaultZonedDateTime
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
assume System default time zone- Parameters:
dateTime
- date-time string- Returns:
- ZonedDateTime
-
parseDefaultMSecWZone
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT_WITH_ZONE
.- Parameters:
dateTimeWithZone
- date-time string- Returns:
- milliseconds
-
parseDefaultDate
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.- Parameters:
dateTime
- date-time string- Returns:
- date
-
parseDefaultCal
Parse the date-time string usingDEFAULT_XMLLIKE_DATE_FORMAT
.- Parameters:
dateTime
- date-time string- Returns:
- calendar
-