''SqlDateTime'' '''

SqlDateTime

System.Data.SqlTypes (system.data.dll) struct

A structure that represents a date and time that can range in value from January 1, 1753 to December 31, 9999, with an accuracy of 3.33 milliseconds. This maps directly to the SQL Server datetime data type. It can also be used for the smalldatetime data type, which can store a date and time from January 1, 1900 to June 6, 2079 with an accuracy of one minute.

public struct SqlDateTime : INullable, IComparable {
// Public Constructors
   public SqlDateTime( DateTime value);  
   public SqlDateTime( int dayTicks, int timeTicks);  
   public SqlDateTime( int year, int month, int day);  
   public SqlDateTime(int year, int month, int day, int hour, int minute, int second);
   public SqlDateTime(int year, int month, int day, int hour, int minute, int second, double millisecond);
   public SqlDateTime(int year, int month, int day, int hour,  int minute, int second, int bilisecond);
// Public Static Fields
   public static readonly SqlDateTime MaxValue;                // =12/31/9999 11:59:59 PM
   public static readonly SqlDateTime MinValue;                // =1/1/1753 12:00:00 AM
   public static readonly SqlDateTime Null;                    // =Null
   public static readonly int SQLTicksPerHour;                 // =1080000
   public static readonly int SQLTicksPerMinute;               // =18000
   public static readonly int SQLTicksPerSecond;               // =300
// Public Instance Properties
   public int DayTicks{get; } 
   public bool IsNull{get; }                                   // implements INullable
   public int TimeTicks{get; } 
   public DateTime Value{get; } 
// Public Static Methods
   public static SqlBoolean Equals(SqlDateTime x, SqlDateTime y); 
   public static SqlBoolean GreaterThan(SqlDateTime x, SqlDateTime y); 
   public static SqlBoolean GreaterThanOrEqual(SqlDateTime x, SqlDateTime y);  
   public static SqlBoolean LessThan(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean LessThanOrEqual(SqlDateTime x, SqlDateTime y); 
   public static SqlBoolean NotEquals(SqlDateTime x, SqlDateTime y);
   public static SqlDateTime Parse( string s);  
   public static SqlDateTime operator -(SqlDateTime x, TimeSpan t);
   public static SqlDateTime operator +(SqlDateTime x, TimeSpan t); 
   public static SqlBoolean operator !=(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean operator <(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean operator <=(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean operator ==(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean operator >(SqlDateTime x, SqlDateTime y);
   public static SqlBoolean operator >=(SqlDateTime x, SqlDateTime y);
   public static explicit operator DateTime( SqlDateTime x);  
   public static explicit operator SqlDateTime( SqlString x);  
   public static implicit operator SqlDateTime(DateTime value);
// Public Instance Methods
   public int CompareTo( object value);                        // implements IComparable
   public override bool Equals( object value);                 // overrides ValueType
   public override int GetHashCode(  );                          // overrides ValueType
   public SqlString ToSqlString(  );  
   public override string ToString(  );                          // overrides ValueType
}

Hierarchy

System.Object figs/U2192.gif System.ValueType figs/U2192.gif SqlDateTime(INullable, System.IComparable)

Returned By

System.Data.SqlClient.SqlDataReader.GetSqlDateTime( ) , SqlString.ToSqlDateTime( )



    Part I: ADO.NET Tutorial
    Part II: ADO.NET Core Classes
    Part III: API Quick Reference
    Chapter 34. The System.Data Namespace