Converts a Date to a string suitable for indexing.

Namespace: Lucene.Net.Documents
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public static string DateToString(
	DateTime date,
	DateTools..::..Resolution resolution
)
Visual Basic
Public Shared Function DateToString ( _
	date As DateTime, _
	resolution As DateTools..::..Resolution _
) As String
Visual C++
public:
static String^ DateToString(
	DateTime date, 
	DateTools..::..Resolution^ resolution
)

Parameters

date
Type: System..::..DateTime
the date to be converted
resolution
Type: Lucene.Net.Documents..::..DateTools..::..Resolution
the desired resolution, see {@link #Round(Date, DateTools.Resolution)}

Return Value

a string in format
CopyC#
yyyyMMddHHmmssSSS
or shorter, depending on
CopyC#
resolution
; using GMT as timezone

See Also