CLucene - a full-featured, c++ search engine
API Documentation
#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. | |
| lucene::document::DateTools::~DateTools | ( | ) |
| 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.
| time | the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT | |
| resolution | the desired resolution, see Resolution |
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.
| dateString | the date string to be converted |
| ParseException | if dateString is not in the expected format |