Lucene.Net 1.9.1 Class Library

DateTools.DateToString Method 

Converts a Date to a string suitable for indexing.

public static string DateToString(
   DateTime date,
   Resolution resolution
);

Parameters

date
the date to be converted
resolution
the desired resolution, see {@link #Round(Date, DateTools.Resolution)}

Return Value

a string in format

yyyyMMddHHmmssSSS
or shorter, depeding on
resolution

See Also

DateTools Class | Lucene.Net.Documents Namespace