Class NumberDateFormat
This parses into date strings and vice-versa. It
uses the given dateFormat and locale to parse and format dates, but before, it
converts to objects or vice-versa.
Note that the value the dates are parsed into and out of represent the number of milliseconds
since January 1, 1970 0:00:00, also known as the "epoch".
Inheritance
System.Object
NumberDateFormat
Assembly: Lucene.Net.QueryParser.dll
public class NumberDateFormat : NumberFormat
Constructors
|
Improve this Doc
View Source
Constructs a NumberDateFormat object using the given dateStyle,
timeStyle, and locale.
Declaration
public NumberDateFormat(DateFormat dateStyle, DateFormat timeStyle, CultureInfo locale)
Parameters
|
Improve this Doc
View Source
Declaration
public NumberDateFormat(string dateFormat, CultureInfo locale)
Parameters
| Type |
Name |
Description |
| System.String |
dateFormat |
Date format used to parse and format dates
|
| CultureInfo |
locale |
|
Fields
|
Improve this Doc
View Source
Declaration
public const long EPOCH = null
Field Value
| Type |
Description |
| System.Int64 |
|
Properties
|
Improve this Doc
View Source
Declaration
public virtual TimeZoneInfo TimeZone { get; set; }
Property Value
| Type |
Description |
| TimeZoneInfo |
|
Methods
|
Improve this Doc
View Source
Declaration
public override string Format(double number)
Parameters
| Type |
Name |
Description |
| System.Double |
number |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
public override string Format(long number)
Parameters
| Type |
Name |
Description |
| System.Int64 |
number |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
public override string Format(object number)
Parameters
| Type |
Name |
Description |
| System.Object |
number |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Returns the .NET date format that will be used to Format the date.
Note that parsing the date uses .
Declaration
public string GetDateFormat()
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
public static string GetDateFormat(DateFormat dateStyle, DateFormat timeStyle, CultureInfo locale)
Parameters
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
Declaration
public override object Parse(string source)
Parameters
| Type |
Name |
Description |
| System.String |
source |
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Declaration
public void SetDateFormat(string dateFormat)
Parameters
| Type |
Name |
Description |
| System.String |
dateFormat |
|