Struct MySqlDateTime
Represents a datetime data type object in a MySql database.
Implements
System.IConvertible
Assembly: MySql.Data.dll
Version: 9.0.0
Syntax
[Serializable]
public struct MySqlDateTime : IComparable, IConvertible
Constructors
MySqlDateTime(MySqlDateTime)
Constructs a new MySqlDateTime object by copying the current value of the given object.
Declaration
public MySqlDateTime(MySqlDateTime mdt)
Parameters
Type |
Name |
Description |
MySqlDateTime |
mdt |
The MySqlDateTime object to copy.
|
MySqlDateTime(DateTime)
Constructs a new MySqlDateTime object by using values from the given DateTime object.
Declaration
public MySqlDateTime(DateTime dt)
Parameters
MySqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Constructs a new MySqlDateTime object by setting the individual time properties to
the given values.
Declaration
public MySqlDateTime(int year, int month, int day, int hour, int minute, int second, int microsecond)
Parameters
Type |
Name |
Description |
Int32 |
year |
The year to use.
|
Int32 |
month |
The month to use.
|
Int32 |
day |
The day to use.
|
Int32 |
hour |
The hour to use.
|
Int32 |
minute |
The minute to use.
|
Int32 |
second |
The second to use.
|
Int32 |
microsecond |
The microsecond to use.
|
MySqlDateTime(String)
Enables the contruction of a MySqlDateTime object by parsing a string.
Declaration
public MySqlDateTime(string dateTime)
Parameters
Type |
Name |
Description |
String |
dateTime |
|
Fields
TimezoneOffset
Defines whether the UTF or local timezone will be used.
Declaration
public int TimezoneOffset
Field Value
Properties
Day
Returns the day portion of this datetime
Declaration
public int Day { readonly get; set; }
Property Value
Hour
Returns the hour portion of this datetime
Declaration
public int Hour { readonly get; set; }
Property Value
IsNull
Returns true if this datetime object has a null value
Declaration
public readonly bool IsNull { get; }
Property Value
IsValidDateTime
Indicates if this object contains a value that can be represented as a DateTime
Declaration
public readonly bool IsValidDateTime { get; }
Property Value
Microsecond
Returns the microseconds portion of this datetime (6 digit precision)
Declaration
public int Microsecond { get; set; }
Property Value
Millisecond
Returns the milliseconds portion of this datetime
expressed as a value between 0 and 999
Declaration
public int Millisecond { get; set; }
Property Value
Minute
Returns the minute portion of this datetime
Declaration
public int Minute { readonly get; set; }
Property Value
Month
Returns the month portion of this datetime
Declaration
public int Month { readonly get; set; }
Property Value
Second
Returns the second portion of this datetime
Declaration
public int Second { readonly get; set; }
Property Value
Value
Declaration
public readonly DateTime Value { get; }
Property Value
Year
Returns the year portion of this datetime
Declaration
public int Year { readonly get; set; }
Property Value
Methods
GetDateTime()
Returns this value as a DateTime
Declaration
public DateTime GetDateTime()
Returns
ToString()
Returns a MySQL specific string representation of this value
Declaration
public override string ToString()
Returns
Overrides
Operators
Explicit(MySqlDateTime to DateTime)
Declaration
public static explicit operator DateTime(MySqlDateTime val)
Parameters
Returns
Explicit Interface Implementations
IComparable.CompareTo(Object)
Declaration
int IComparable.CompareTo(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
IConvertible.GetTypeCode()
Declaration
TypeCode IConvertible.GetTypeCode()
Returns
Declaration
bool IConvertible.ToBoolean(IFormatProvider provider)
Parameters
Returns
Declaration
byte IConvertible.ToByte(IFormatProvider provider)
Parameters
Returns
Declaration
char IConvertible.ToChar(IFormatProvider provider)
Parameters
Returns
Declaration
DateTime IConvertible.ToDateTime(IFormatProvider provider)
Parameters
Returns
Declaration
decimal IConvertible.ToDecimal(IFormatProvider provider)
Parameters
Returns
Declaration
double IConvertible.ToDouble(IFormatProvider provider)
Parameters
Returns
Type |
Description |
System.Double |
|
Declaration
short IConvertible.ToInt16(IFormatProvider provider)
Parameters
Returns
Declaration
int IConvertible.ToInt32(IFormatProvider provider)
Parameters
Returns
Declaration
long IConvertible.ToInt64(IFormatProvider provider)
Parameters
Returns
Type |
Description |
System.Int64 |
|
Declaration
sbyte IConvertible.ToSByte(IFormatProvider provider)
Parameters
Returns
Type |
Description |
System.SByte |
|
Declaration
float IConvertible.ToSingle(IFormatProvider provider)
Parameters
Returns
Declaration
string IConvertible.ToString(IFormatProvider provider)
Parameters
Returns
Declaration
object IConvertible.ToType(Type conversionType, IFormatProvider provider)
Parameters
Returns
Declaration
ushort IConvertible.ToUInt16(IFormatProvider provider)
Parameters
Returns
Type |
Description |
System.UInt16 |
|
Declaration
uint IConvertible.ToUInt32(IFormatProvider provider)
Parameters
Returns
Declaration
ulong IConvertible.ToUInt64(IFormatProvider provider)
Parameters
Returns
Implements
System.IConvertible