SqlDateTime Structure
TOC
Collapse the table of content
Expand the table of content

SqlDateTime Structure

 

Represents the date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds to be stored in or retrieved from a database. The SqlDateTime structure has a different underlying data structure from its corresponding .NET Framework type, DateTime, which can represent any time between 12:00:00 AM 1/1/0001 and 11:59:59 PM 12/31/9999, to the accuracy of 100 nanoseconds. SqlDateTime actually stores the relative difference to 00:00:00 AM 1/1/1900. Therefore, a conversion from "00:00:00 AM 1/1/1900" to an integer will return 0.

Namespace:   System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)

[SerializableAttribute]
public struct SqlDateTime : INullable, IComparable, IXmlSerializable

NameDescription
System_CAPS_pubmethodSqlDateTime(DateTime)

Initializes a new instance of the SqlDateTime structure using the specified DateTime value.

System_CAPS_pubmethodSqlDateTime(Int32, Int32)

Initializes a new instance of the SqlDateTime structure using the supplied parameters.

System_CAPS_pubmethodSqlDateTime(Int32, Int32, Int32)

Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day.

System_CAPS_pubmethodSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32)

Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, and second of the new structure.

System_CAPS_pubmethodSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Double)

Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and millisecond of the new structure.

System_CAPS_pubmethodSqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Initializes a new instance of the SqlDateTime structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and billisecond of the new structure.

NameDescription
System_CAPS_pubpropertyDayTicks

Gets the number of ticks representing the date of this SqlDateTime structure.

System_CAPS_pubpropertyIsNull

Indicates whether this SqlDateTime structure is null.

System_CAPS_pubpropertyTimeTicks

Gets the number of ticks representing the time of this SqlDateTime structure.

System_CAPS_pubpropertyValue

Gets the value of the SqlDateTime structure. This property is read-only.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAdd(SqlDateTime, TimeSpan)

Adds a SqlDateTime to the specified TimeSpan.

System_CAPS_pubmethodCompareTo(Object)

Compares this SqlDateTime structure to the supplied Object and returns an indication of their relative values.

System_CAPS_pubmethodCompareTo(SqlDateTime)

Compares this SqlDateTime structure to the supplied SqlDateTime structure and returns an indication of their relative values.

System_CAPS_pubmethodEquals(Object)

Compares the supplied object parameter to the Value property of the SqlDateTime object.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodSystem_CAPS_staticEquals(SqlDateTime, SqlDateTime)

Performs a logical comparison of two SqlDateTime structures to determine whether they are equal.

System_CAPS_pubmethodGetHashCode()

Gets the hash code for this instance.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetXsdType(XmlSchemaSet)

Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.

System_CAPS_pubmethodSystem_CAPS_staticGreaterThan(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is greater than the second.

System_CAPS_pubmethodSystem_CAPS_staticGreaterThanOrEqual(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is greater than or equal to the second.

System_CAPS_pubmethodSystem_CAPS_staticLessThan(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is less than the second.

System_CAPS_pubmethodSystem_CAPS_staticLessThanOrEqual(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is less than or equal to the second.

System_CAPS_pubmethodSystem_CAPS_staticNotEquals(SqlDateTime, SqlDateTime)

Performs a logical comparison of two instances of SqlDateTime to determine whether they are not equal.

System_CAPS_pubmethodSystem_CAPS_staticParse(String)

Converts the specified String representation of a date and time to its SqlDateTime equivalent.

System_CAPS_pubmethodSystem_CAPS_staticSubtract(SqlDateTime, TimeSpan)

Subtracts the specified Timespan from this SqlDateTime instance.

System_CAPS_pubmethodToSqlString()

Converts this SqlDateTime structure to SqlString.

System_CAPS_pubmethodToString()

Converts this SqlDateTime structure to a String.(Overrides ValueType.ToString().)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticMaxValue

Represents the maximum valid date value for a SqlDateTime structure.

System_CAPS_pubfieldSystem_CAPS_staticMinValue

Represents the minimum valid date value for a SqlDateTime structure.

System_CAPS_pubfieldSystem_CAPS_staticNull

Represents a DBNull that can be assigned to this instance of the SqlDateTime structure.

System_CAPS_pubfieldSystem_CAPS_staticSQLTicksPerHour

A constant whose value is the number of ticks equivalent to one hour.

System_CAPS_pubfieldSystem_CAPS_staticSQLTicksPerMinute

A constant whose value is the number of ticks equivalent to one minute.

System_CAPS_pubfieldSystem_CAPS_staticSQLTicksPerSecond

A constant whose value is the number of ticks equivalent to one second.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticAddition(SqlDateTime, TimeSpan)

Adds the period of time indicated by the supplied TimeSpan parameter, t, to the supplied SqlDateTime structure.

System_CAPS_puboperatorSystem_CAPS_staticEquality(SqlDateTime, SqlDateTime)

Performs a logical comparison of two SqlDateTime structures to determine whether they are equal.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlDateTime to DateTime)

Converts the SqlDateTime structure to a DateTime structure.

System_CAPS_puboperatorSystem_CAPS_staticExplicit(SqlString to SqlDateTime)

Converts the SqlString parameter to a SqlDateTime.

System_CAPS_puboperatorSystem_CAPS_staticGreaterThan(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is greater than the second.

System_CAPS_puboperatorSystem_CAPS_staticGreaterThanOrEqual(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is greater than or equal to the second.

System_CAPS_puboperatorSystem_CAPS_staticImplicit(DateTime to SqlDateTime)

Converts a DateTime structure to a SqlDateTime structure.

System_CAPS_puboperatorSystem_CAPS_staticInequality(SqlDateTime, SqlDateTime)

Performs a logical comparison of two instances of SqlDateTime to determine whether they are not equal.

System_CAPS_puboperatorSystem_CAPS_staticLessThan(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is less than the second.

System_CAPS_puboperatorSystem_CAPS_staticLessThanOrEqual(SqlDateTime, SqlDateTime)

Compares two instances of SqlDateTime to determine whether the first is less than or equal to the second.

System_CAPS_puboperatorSystem_CAPS_staticSubtraction(SqlDateTime, TimeSpan)

Subtracts the supplied TimeSpan structure, t, from the supplied SqlDateTime structure.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.GetSchema()

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.ReadXml(XmlReader)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIXmlSerializable.WriteXml(XmlWriter)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft