Class OLuceneDateTools
java.lang.Object
com.orientechnologies.lucene.builder.OLuceneDateTools
This utility class replace the
DateTools from Lucene code
base.
It uses the TimeZone defined at database level and maintains only methods
for string conversion to Date or long value.
- Author:
- frank
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the time granularity. -
Method Summary
Modifier and TypeMethodDescriptionstatic DatestringToDate(String dateString) Converts a string produced bytimeToStringordateToStringback to a time, represented as a Date object.static longstringToTime(String dateString) Converts a string produced bytimeToStringordateToStringback to a time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
-
Method Details
-
stringToTime
Converts a string produced bytimeToStringordateToStringback to a time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT.- Parameters:
dateString- the date string to be converted- Returns:
- the number of milliseconds since January 1, 1970, 00:00:00 GMT
- Throws:
ParseException- ifdateStringis not in the expected format
-
stringToDate
Converts a string produced bytimeToStringordateToStringback to a time, represented as a Date object.- Parameters:
dateString- the date string to be converted- Returns:
- the parsed time as a Date object
- Throws:
ParseException- ifdateStringis not in the expected format
-