CLucene - a full-featured, c++ search engine
API Documentation


lucene::document::DateTools Class Reference

#include <DateTools.h>


Public Types

enum  Resolution {
  YEAR_FORMAT, MONTH_FORMAT, DAY_FORMAT, HOUR_FORMAT,
  MINUTE_FORMAT, SECOND_FORMAT, MILLISECOND_FORMAT
}

Public Member Functions

 ~DateTools ()

Static Public Member Functions

static TCHAR * timeToString (const int64_t time, Resolution resolution=MILLISECOND_FORMAT)
 Converts a millisecond time to a string suitable for indexing.
static void timeToString (const int64_t time, Resolution resolution, TCHAR *buf)
static int64_t stringToTime (const TCHAR *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.


Member Enumeration Documentation

Enumerator:
YEAR_FORMAT 
MONTH_FORMAT 
DAY_FORMAT 
HOUR_FORMAT 
MINUTE_FORMAT 
SECOND_FORMAT 
MILLISECOND_FORMAT 


Constructor & Destructor Documentation

lucene::document::DateTools::~DateTools (  ) 


Member Function Documentation

static TCHAR* lucene::document::DateTools::timeToString ( const int64_t  time,
Resolution  resolution = MILLISECOND_FORMAT 
) [static]

Converts a millisecond time to a string suitable for indexing.

Parameters:
time the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT
resolution the desired resolution, see Resolution
Returns:
a string in format yyyyMMddHHmmssSSS or shorter, depeding on resolution; using UTC as timezone

static void lucene::document::DateTools::timeToString ( const int64_t  time,
Resolution  resolution,
TCHAR *  buf 
) [static]

static int64_t lucene::document::DateTools::stringToTime ( const TCHAR *  dateString  )  [static]

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
Exceptions:
ParseException if dateString is not in the expected format


The documentation for this class was generated from the following file:

clucene.sourceforge.net