<PackageReference Include="System.Data.SqlClient" Version="4.7.0-preview3.19128.7" />

SqlDateTime

public struct SqlDateTime : INullable, IComparable
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 &quot;00:00:00 AM 1/1/1900&quot; to an integer will return 0.
public static readonly SqlDateTime MaxValue

Represents the maximum valid date value for a SqlDateTime structure.

public static readonly SqlDateTime MinValue

Represents the minimum valid date value for a SqlDateTime structure.

public static readonly SqlDateTime Null

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

public static readonly int SQLTicksPerHour

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

public static readonly int SQLTicksPerMinute

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

public static readonly int SQLTicksPerSecond

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

public int DayTicks { get; }

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

public bool IsNull { get; }

Indicates whether this SqlDateTime structure is null.

public int TimeTicks { get; }

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

public DateTime Value { get; }

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

public SqlDateTime(DateTime value)

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

public SqlDateTime(int dayTicks, int timeTicks)

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

public SqlDateTime(int year, int month, int day)

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

public SqlDateTime(int year, int month, int day, int hour, int minute, int second)

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.

public SqlDateTime(int year, int month, int day, int hour, int minute, int second, double millisecond)

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.

public SqlDateTime(int year, int month, int day, int hour, int minute, int second, int bilisecond)

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.

public static SqlDateTime Add(SqlDateTime x, TimeSpan t)

Adds a SqlDateTime to the specified TimeSpan.

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

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

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

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

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

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

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

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

public static DateTime op_Explicit(SqlDateTime x)

Converts the SqlDateTime structure to a DateTime structure.

Converts the SqlString parameter to a SqlDateTime.

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

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

public static SqlDateTime op_Implicit(DateTime value)

Converts a DateTime structure to a SqlDateTime structure.

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

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

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

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

public static SqlDateTime Parse(string s)

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

Subtracts the specified Timespan from this SqlDateTime instance.

public int CompareTo(SqlDateTime value)

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

public int CompareTo(object value)

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

Converts this SqlDateTime structure to SqlString.