Date and Time Types in Sql Server

Date and Time Types

Sql server supports the following date and time types

1) Date
   It defines only date

2) Time [(Fractional Second precision)]
   Defines a Time of a day.This time is without time zone awareness and is based on 24-hour clock

3) DateTime
   Defines a Date that is combined with a time of day with fractional seconds that is based on a 24-hour clock

4) SmallDateTime
    Defines a Date that is combined with a time of day.The Time is based on a 24-hour clock,with seconds always zero (:00) without fractional seconds

5) DatTime2 [(Fractional Second precision)]
   Defines a Date that is combined with a time of day with fractional seconds that is based on a 24-hour clock.DateTime2 considered as an extension of the above    DATETIME type that has a larger date range

6) DateTimeoffset [(Fractional Second precision)]
     Defines a Date that is combined with a time of a day that has time zone awarness and is based on a 24-hour clock


     DataType           Range                                                    Storage
   ------------       ------------------                                   --------------------
      Date             0001-01-01 through  9999-12-31                             3 bytes

      Time             00:00:00.0000000 through 23:59:59.9999999                  5 bytes

     DateTime         DateRange:January 1,1753 through December 31,9999           8 bytes
                      TimeRange: 00:00:00 through 23:59:59.997

    SmallDateTime     DateRange: January 1,1900 through june 6,2079               4 bytes
                      TimeRange: 00:00:00 through 23:59:59

    DateTime2        DateRange: January 1,0001 AD through December 31,9999 AD     6 bytes of prescisions <3 p="">                     TimeRange: 00:00:00 through 23:59:59.9999999                 7 bytes of prescisions 3 & 4
                                                                                  8 bytes of other prescisions

 DateTimeOffset   DateRange: January 1,0001 AD through December 31,9999 AA     10 bytes
                      TimeRange: 00:00:00 through 23:59:59.9999999
About Author: author 4 + years of Information Technology experience in understanding and analyzing the software and hardware engineering requirements, onsite and offshore management of product development. Expert work on design and development for windows,web,mobile Expert knowledge of C#,ADO.NET, ASP.Net MVC, ENTITY FRAMEWORK, LINQ,COLLECTIONS, JAVASCRIPT,AngularJs 1.0,Angular2, Jquery,Jquery-Ajax, SQL SERVER, XAML,Windows phone 8.1 Good knowledge of WCF-Restful services,WCF, WEB API-Services ,Web- Services,MIcrosoft-Azure,JUICE UI,HTML,CSS,AJAX Read More...

Join him on Google+ | Facebook | Linkedin

No comments