Struct NDate
This maps the Oracle(c) Date type
Inherited Members
Namespace:Foundations.Core.Types
Assembly:Foundations.Core.Types.dll
Syntax
[Serializable]
public struct NDate : INullable, IConvertible, IFormattable, IComparable
Constructors
NDate(DateTime)
Initializes a new instance of the NDate class.
Declaration
public NDate(DateTime val)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | val | The val. |
NDate(DateTime, Boolean)
Initializes a new instance of the NDate class.
Declaration
public NDate(DateTime val, bool hasTime)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | val | The value |
System.Boolean | hasTime | Indicates if the new Date object has or not the time part |
NDate(Int32, Int32, Int32)
Initializes a new instance of the NDate class.
Declaration
public NDate(int year, int month, int day)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | year | The year. |
System.Int32 | month | The month. |
System.Int32 | day | The day. |
Fields
Format
The application wide datetime format
Declaration
public static string Format
Field Value
Type | Description |
---|---|
System.String |
Properties
HasTime
Indicates if the Date value has time part
Declaration
public bool HasTime { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsNull
Gets a value indicating whether this instance is null.
Declaration
public bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Implements
Now
Gets the now.
Declaration
public static NDate Now { get; }
Property Value
Type | Description |
---|---|
NDate | The now. |
NDate
Gets the null.
Declaration
public static NDate Null { get; }
Property Value
Type | Description |
---|---|
NDate | The null. |
TimeOfDay
Declaration
public TimeSpan TimeOfDay { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Today
Declaration
public static NDate Today { get; }
Property Value
Type | Description |
---|---|
NDate |
Value
Gets the value.
Declaration
public DateTime Value { get; }
Property Value
Type | Description |
---|---|
System.DateTime | The value. |
Methods
ClearTime()
Date value without time part
Declaration
public void ClearTime()
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Int32 |
Implements
Equals(Object)
Equalses the specified n.
Declaration
public override bool Equals(object n)
Parameters
Type | Name | Description |
---|---|---|
System.Object | n | The n. |
Returns
Type | Description |
---|---|
System.Boolean | The boolean value, true for equallity. |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that is the hash code for this instance. |
Overrides
GetTypeCode()
Returns the System.TypeCode for this instance.
Declaration
public TypeCode GetTypeCode()
Returns
Type | Description |
---|---|
System.TypeCode | The enumerated constant that is the System.TypeCode of the class or value type that implements this interface. |
Implements
Parse(String)
Parses the specified date string.
Declaration
public static NDate Parse(string dateString)
Parameters
Type | Name | Description |
---|---|---|
System.String | dateString | The date string |
Returns
Type | Description |
---|---|
NDate | The Date value |
Parse(String, CultureInfo)
Declaration
public static NDate Parse(string dateString, CultureInfo ci)
Parameters
Type | Name | Description |
---|---|---|
System.String | dateString | |
System.Globalization.CultureInfo | ci |
Returns
Type | Description |
---|---|
NDate |
Parse(String, String)
Parses the specified date string based on the given format
Declaration
public static NDate Parse(string dateString, string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | dateString | The date string |
System.String | format | The date format |
Returns
Type | Description |
---|---|
NDate | The Date value |
ToBoolean()
Toes the boolean.
Declaration
public bool ToBoolean()
Returns
Type | Description |
---|---|
System.Boolean |
ToBoolean(IFormatProvider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.
Declaration
public bool ToBoolean(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Boolean | A Boolean value equivalent to the value of this instance. |
Implements
ToByte()
Toes the byte.
Declaration
public byte ToByte()
Returns
Type | Description |
---|---|
System.Byte |
ToByte(IFormatProvider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.
Declaration
public byte ToByte(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Byte | An 8-bit unsigned integer equivalent to the value of this instance. |
Implements
ToChar()
Toes the char.
Declaration
public char ToChar()
Returns
Type | Description |
---|---|
System.Char |
ToChar(IFormatProvider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.
Declaration
public char ToChar(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Char | A Unicode character equivalent to the value of this instance. |
Implements
ToDate(Object)
Special conversion method to convert object references to Date references
Declaration
public static NDate ToDate(object val)
Parameters
Type | Name | Description |
---|---|---|
System.Object | val | The object to be converted |
Returns
Type | Description |
---|---|
NDate | The Date object |
ToDateTime()
Toes the date time.
Declaration
public DateTime ToDateTime()
Returns
Type | Description |
---|---|
System.DateTime |
ToDateTime(IFormatProvider)
Converts the value of this instance to an equivalent System.DateTime using the specified culture-specific formatting information.
Declaration
public DateTime ToDateTime(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.DateTime | A System.DateTime instance equivalent to the value of this instance. |
Implements
ToDecimal()
Toes the decimal.
Declaration
public decimal ToDecimal()
Returns
Type | Description |
---|---|
System.Decimal |
ToDecimal(IFormatProvider)
Converts the value of this instance to an equivalent System.Decimal number using the specified culture-specific formatting information.
Declaration
public decimal ToDecimal(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Decimal | A System.Decimal number equivalent to the value of this instance. |
Implements
ToDouble()
Toes the double.
Declaration
public double ToDouble()
Returns
Type | Description |
---|---|
System.Double |
ToDouble(IFormatProvider)
Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.
Declaration
public double ToDouble(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Double | A double-precision floating-point number equivalent to the value of this instance. |
Implements
ToInt16()
Toes the int16.
Declaration
public short ToInt16()
Returns
Type | Description |
---|---|
System.Int16 |
ToInt16(IFormatProvider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
Declaration
public short ToInt16(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Int16 | An 16-bit signed integer equivalent to the value of this instance. |
Implements
ToInt32()
Toes the int32.
Declaration
public int ToInt32()
Returns
Type | Description |
---|---|
System.Int32 |
ToInt32(IFormatProvider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.
Declaration
public int ToInt32(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Int32 | An 32-bit signed integer equivalent to the value of this instance. |
Implements
ToInt64()
Toes the int64.
Declaration
public long ToInt64()
Returns
Type | Description |
---|---|
System.Int64 |
ToInt64(IFormatProvider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.
Declaration
public long ToInt64(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Int64 | An 64-bit signed integer equivalent to the value of this instance. |
Implements
ToObject()
Toes the object.
Declaration
public object ToObject()
Returns
Type | Description |
---|---|
System.Object | Returns the object |
ToSByte()
Toes the S byte.
Declaration
public sbyte ToSByte()
Returns
Type | Description |
---|---|
System.SByte |
ToSByte(IFormatProvider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.
Declaration
public sbyte ToSByte(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.SByte | An 8-bit signed integer equivalent to the value of this instance. |
Implements
ToSingle()
Toes the single.
Declaration
public float ToSingle()
Returns
Type | Description |
---|---|
System.Single |
ToSingle(IFormatProvider)
Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.
Declaration
public float ToSingle(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Single | A single-precision floating-point number equivalent to the value of this instance. |
Implements
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String containing a fully qualified type name. |
Overrides
ToString(IFormatProvider)
Converts the value of this instance to an equivalent System.String using the specified culture-specific formatting information.
Declaration
public string ToString(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.String | A System.String instance equivalent to the value of this instance. |
Implements
ToString(String)
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format |
Returns
Type | Description |
---|---|
System.String |
ToString(String, IFormatProvider)
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | |
System.IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
System.String |
Implements
ToType(Type, IFormatProvider)
Converts the value of this instance to an System.Object of the specified System.Type that has an equivalent value, using the specified culture-specific formatting information.
Declaration
public object ToType(Type conversionType, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.Type | conversionType | The System.Type to which the value of this instance is converted. |
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.Object | An System.Object instance of type conversionType whose value is equivalent to the value of this instance. |
Implements
ToUInt16()
Toes the U int16.
Declaration
public ushort ToUInt16()
Returns
Type | Description |
---|---|
System.UInt16 |
ToUInt16(IFormatProvider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.
Declaration
public ushort ToUInt16(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.UInt16 | An 16-bit unsigned integer equivalent to the value of this instance. |
Implements
ToUInt32()
Toes the U int32.
Declaration
public uint ToUInt32()
Returns
Type | Description |
---|---|
System.UInt32 |
ToUInt32(IFormatProvider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.
Declaration
public uint ToUInt32(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.UInt32 | An 32-bit unsigned integer equivalent to the value of this instance. |
Implements
ToUInt64()
Toes the U int64.
Declaration
public ulong ToUInt64()
Returns
Type | Description |
---|---|
System.UInt64 |
ToUInt64(IFormatProvider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.
Declaration
public ulong ToUInt64(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | An System.IFormatProvider interface implementation that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.UInt64 | An 64-bit unsigned integer equivalent to the value of this instance. |
Implements
Operators
Addition(NDate, Double)
Implements the operator +.
Declaration
public static NDate operator +(NDate d1, double n)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.Double | n | The n. |
Returns
Type | Description |
---|---|
NDate | The result of the operator. |
Addition(NDate, Int32)
Implements the operator +.
Declaration
public static NDate operator +(NDate d1, int n)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.Int32 | n | The n. |
Returns
Type | Description |
---|---|
NDate | The result of the operator. |
Addition(NDate, TimeSpan)
Declaration
public static NDate operator +(NDate d1, TimeSpan time)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | |
System.TimeSpan | time |
Returns
Type | Description |
---|---|
NDate |
Equality(NDate, NDate)
Implements the operator ==.
Declaration
public static NBool operator ==(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Equality(NDate, NString)
Implements the operator ==.
Declaration
public static NBool operator ==(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Equality(NDate, String)
Implements the operator ==.
Declaration
public static NBool operator ==(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Explicit(NDate to DateTime)
Performs an explicit conversion from NDate to System.DateTime.
Declaration
public static explicit operator DateTime(NDate val)
Parameters
Type | Name | Description |
---|---|---|
NDate | val | The val. |
Returns
Type | Description |
---|---|
System.DateTime | The result of the conversion. |
GreaterThan(NDate, NDate)
Implements the operator >.
Declaration
public static NBool operator>(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
GreaterThan(NDate, NString)
Implements the operator >.
Declaration
public static NBool operator>(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
GreaterThan(NDate, String)
Implements the operator >.
Declaration
public static NBool operator>(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
GreaterThanOrEqual(NDate, NDate)
Implements the operator >=.
Declaration
public static NBool operator >=(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
GreaterThanOrEqual(NDate, NString)
Implements the operator >=.
Declaration
public static NBool operator >=(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
GreaterThanOrEqual(NDate, String)
Implements the operator >=.
Declaration
public static NBool operator >=(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Implicit(NDate to String)
Performs an implicit conversion from NDate to System.String.
Declaration
public static implicit operator string (NDate date)
Parameters
Type | Name | Description |
---|---|---|
NDate | date | The date. |
Returns
Type | Description |
---|---|
System.String | The result of the conversion. |
Implicit(DateTime to NDate)
Performs an implicit conversion from System.DateTime to NDate.
Declaration
public static implicit operator NDate(DateTime val)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | val | The val. |
Returns
Type | Description |
---|---|
NDate | The result of the conversion. |
Implicit(String to NDate)
Performs an implicit conversion from System.String to NDate.
Declaration
public static implicit operator NDate(string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | val | The val. |
Returns
Type | Description |
---|---|
NDate | The result of the conversion. |
Inequality(NDate, NDate)
Implements the operator !=.
Declaration
public static NBool operator !=(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Inequality(NDate, NString)
Implements the operator !=.
Declaration
public static NBool operator !=(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Inequality(NDate, String)
Implements the operator !=.
Declaration
public static NBool operator !=(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThan(NDate, NDate)
Implements the operator <.
Declaration
public static NBool operator <(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThan(NDate, NString)
Implements the operator <.
Declaration
public static NBool operator <(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThan(NDate, String)
Implements the operator <.
Declaration
public static NBool operator <(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThanOrEqual(NDate, NDate)
Implements the operator <=.
Declaration
public static NBool operator <=(NDate d1, NDate d2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NDate | d2 | The d2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThanOrEqual(NDate, NString)
Implements the operator <=.
Declaration
public static NBool operator <=(NDate d1, NString s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
NString | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
LessThanOrEqual(NDate, String)
Implements the operator <=.
Declaration
public static NBool operator <=(NDate d1, string s2)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.String | s2 | The s2. |
Returns
Type | Description |
---|---|
NBool | The result of the operator. |
Subtraction(NDate, NDate)
Implements the operator -.
Declaration
public static TimeSpan operator -(NDate n1, NDate n2)
Parameters
Type | Name | Description |
---|---|---|
NDate | n1 | The n1. |
NDate | n2 | The n2. |
Returns
Type | Description |
---|---|
System.TimeSpan | The result of the operator. |
Subtraction(NDate, Int32)
Implements the operator -.
Declaration
public static NDate operator -(NDate d1, int n)
Parameters
Type | Name | Description |
---|---|---|
NDate | d1 | The d1. |
System.Int32 | n | The n. |
Returns
Type | Description |
---|---|
NDate | The result of the operator. |