Class OLuceneDateTools

java.lang.Object
com.orientechnologies.lucene.builder.OLuceneDateTools

public class OLuceneDateTools extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Specifies the time granularity.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Date
    stringToDate(String dateString)
    Converts a string produced by timeToString or dateToString back to a time, represented as a Date object.
    static long
    stringToTime(String dateString)
    Converts a string produced by timeToString or dateToString back to a time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • stringToTime

      public static long stringToTime(String dateString) throws ParseException
      Converts a string produced by timeToString or dateToString back 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 - if dateString is not in the expected format
    • stringToDate

      public static Date stringToDate(String dateString) throws ParseException
      Converts a string produced by timeToString or dateToString back 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 - if dateString is not in the expected format