SqlDateTime SqlDateTime SqlDateTime SqlDateTime Struct

Definition

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.

public value class SqlDateTime : IComparable, System::Data::SqlTypes::INullable, System::Xml::Serialization::IXmlSerializable
[Serializable]
public struct SqlDateTime : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializable
type SqlDateTime = struct
    interface INullable
    interface IXmlSerializable
Public Structure SqlDateTime
Implements IComparable, INullable, IXmlSerializable
Inheritance
SqlDateTimeSqlDateTimeSqlDateTimeSqlDateTime
Attributes
SerializableAttribute
Implements

Constructors

SqlDateTime(DateTime) SqlDateTime(DateTime) SqlDateTime(DateTime) SqlDateTime(DateTime)

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

SqlDateTime(Int32, Int32) SqlDateTime(Int32, Int32) SqlDateTime(Int32, Int32) SqlDateTime(Int32, Int32)

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

SqlDateTime(Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32)

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

SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(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.

SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Double) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Double) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Double) SqlDateTime(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.

SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(Int32, Int32, Int32, Int32, Int32, Int32, Int32) SqlDateTime(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 microsecond of the new structure.

Fields

MaxValue MaxValue MaxValue MaxValue

Represents the maximum valid date value for a SqlDateTime structure.

MinValue MinValue MinValue MinValue

Represents the minimum valid date value for a SqlDateTime structure.

Null Null Null Null

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

SQLTicksPerHour SQLTicksPerHour SQLTicksPerHour SQLTicksPerHour

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

SQLTicksPerMinute SQLTicksPerMinute SQLTicksPerMinute SQLTicksPerMinute

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

SQLTicksPerSecond SQLTicksPerSecond SQLTicksPerSecond SQLTicksPerSecond

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

Properties

DayTicks DayTicks DayTicks DayTicks

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

IsNull IsNull IsNull IsNull

Indicates whether this SqlDateTime structure is null.

TimeTicks TimeTicks TimeTicks TimeTicks

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

Value Value Value Value

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

Methods

Add(SqlDateTime, TimeSpan) Add(SqlDateTime, TimeSpan) Add(SqlDateTime, TimeSpan) Add(SqlDateTime, TimeSpan)

Adds a SqlDateTime to the specified TimeSpan.

CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime)

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

CompareTo(Object) CompareTo(Object) CompareTo(Object) CompareTo(Object)

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

Equals(SqlDateTime, SqlDateTime) Equals(SqlDateTime, SqlDateTime) Equals(SqlDateTime, SqlDateTime) Equals(SqlDateTime, SqlDateTime)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Compares the supplied object parameter to the Value property of the SqlDateTime object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Gets the hash code for this instance.

GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet)

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

GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime)

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

GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime)

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

LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime)

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

LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime)

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

NotEquals(SqlDateTime, SqlDateTime) NotEquals(SqlDateTime, SqlDateTime) NotEquals(SqlDateTime, SqlDateTime) NotEquals(SqlDateTime, SqlDateTime)

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

Parse(String) Parse(String) Parse(String) Parse(String)

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

Subtract(SqlDateTime, TimeSpan) Subtract(SqlDateTime, TimeSpan) Subtract(SqlDateTime, TimeSpan) Subtract(SqlDateTime, TimeSpan)

Subtracts the specified Timespan from this SqlDateTime instance.

ToSqlString() ToSqlString() ToSqlString() ToSqlString()

Converts this SqlDateTime structure to SqlString.

ToString() ToString() ToString() ToString()

Converts this SqlDateTime structure to a String.

Operators

Addition(SqlDateTime, TimeSpan) Addition(SqlDateTime, TimeSpan) Addition(SqlDateTime, TimeSpan) Addition(SqlDateTime, TimeSpan)

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

Equality(SqlDateTime, SqlDateTime) Equality(SqlDateTime, SqlDateTime) Equality(SqlDateTime, SqlDateTime) Equality(SqlDateTime, SqlDateTime)

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

Explicit(SqlDateTime to DateTime) Explicit(SqlDateTime to DateTime) Explicit(SqlDateTime to DateTime) Explicit(SqlDateTime to DateTime)

Converts the SqlDateTime structure to a DateTime structure.

Explicit(SqlString to SqlDateTime) Explicit(SqlString to SqlDateTime) Explicit(SqlString to SqlDateTime) Explicit(SqlString to SqlDateTime)

Converts the SqlString parameter to a SqlDateTime.

GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime) GreaterThan(SqlDateTime, SqlDateTime)

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

GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime) GreaterThanOrEqual(SqlDateTime, SqlDateTime)

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

Implicit(DateTime to SqlDateTime) Implicit(DateTime to SqlDateTime) Implicit(DateTime to SqlDateTime) Implicit(DateTime to SqlDateTime)

Converts a DateTime structure to a SqlDateTime structure.

Inequality(SqlDateTime, SqlDateTime) Inequality(SqlDateTime, SqlDateTime) Inequality(SqlDateTime, SqlDateTime) Inequality(SqlDateTime, SqlDateTime)

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

LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime) LessThan(SqlDateTime, SqlDateTime)

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

LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime) LessThanOrEqual(SqlDateTime, SqlDateTime)

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

Subtraction(SqlDateTime, TimeSpan) Subtraction(SqlDateTime, TimeSpan) Subtraction(SqlDateTime, TimeSpan) Subtraction(SqlDateTime, TimeSpan)

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

Explicit Interface Implementations

IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema()

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

IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader)

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

IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter)

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

Applies to

See Also