Class NumberDateFormat
This Lucene.Net.Util.NumberFormat parses System.Int64 into date strings and vice-versa. It
uses the given dateFormat
and System.Globalization.CultureInfo to parse and format dates, but before, it
converts System.Int64 to System.DateTime objects or vice-versa.
Note that the System.Int64 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
Lucene.Net.Util.NumberFormat
NumberDateFormat
Inherited Members
Lucene.Net.Util.NumberFormat.Culture
Lucene.Net.Util.NumberFormat.GetNumberFormat()
Lucene.Net.Util.NumberFormat.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 culture
.
Declaration
public NumberDateFormat(DateFormat dateStyle, DateFormat timeStyle, CultureInfo culture)
Parameters
Type |
Name |
Description |
DateFormat |
dateStyle |
|
DateFormat |
timeStyle |
|
System.Globalization.CultureInfo |
culture |
|
|
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
|
System.Globalization.CultureInfo |
locale |
|
Fields
|
Improve this Doc
View Source
Declaration
public const long EPOCH = 621355968000000000L
Field Value
Type |
Description |
System.Int64 |
|
Properties
|
Improve this Doc
View Source
Declaration
public virtual TimeZoneInfo TimeZone { get; set; }
Property Value
Type |
Description |
System.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 |
|
Overrides
|
Improve this Doc
View Source
Declaration
public override string Format(long number)
Parameters
Type |
Name |
Description |
System.Int64 |
number |
|
Returns
Type |
Description |
System.String |
|
Overrides
|
Improve this Doc
View Source
Declaration
public override string Format(object number)
Parameters
Type |
Name |
Description |
System.Object |
number |
|
Returns
Type |
Description |
System.String |
|
Overrides
|
Improve this Doc
View Source
Returns the .NET date format that will be used to Format the date.
Note that parsing the date uses System.DateTime.ParseExact(System.String,System.String,System.IFormatProvider).
Declaration
public string GetDateFormat()
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Declaration
public static string GetDateFormat(DateFormat dateStyle, DateFormat timeStyle, CultureInfo culture)
Parameters
Type |
Name |
Description |
DateFormat |
dateStyle |
|
DateFormat |
timeStyle |
|
System.Globalization.CultureInfo |
culture |
|
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 |
|
Overrides
|
Improve this Doc
View Source
Declaration
public void SetDateFormat(string dateFormat)
Parameters
Type |
Name |
Description |
System.String |
dateFormat |
|