O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Datetime Types

Use datetime data types to represent the date and time of day. Datetime values have these characteristics:

  • They’re specified with a relationship to UTC, or Universal Coordinated Time (formerly called Greenwich Mean Time or GMT). SQL-92 requires that every SQL session have a default offset from UTC that is used for the duration of the session. –8 hours is the normal time-zone offset of San Francisco, California, for example.

  • The natural rules of the Gregorian calendar determine how date values are formed. DBMSes reject values that they can’t recognize as dates.

  • Time values are based on a 24-hour clock, also called military time (use 13:00, not 1:00 P.M.).

  • Hyphens (-) separate the parts of a date, and colons (:) separate the parts ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required