What is the difference between time and timestamp data type in MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hitesh Kapoor
    New Member
    • Sep 2012
    • 1

    What is the difference between time and timestamp data type in MySQL

    What is the difference between time and timestamp data type in MySQL?
    Last edited by Niheel; Sep 10 '12, 07:13 AM.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    TIME only stores what would be considered a time interval. TIME values may range from '-838:59:59' to '838:59:59'.

    TIMESTAMP stores a date and time. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.

    Comment

    • VanessaMeacham
      New Member
      • Sep 2012
      • 31

      #3
      Hi! MySQL displays TIMESTAMP values using the same format as DATETIME values; that is, 'YYYY-MM-DD hh:mm:ss'.TIMES TAMP values actually represent the number of seconds elapsed since the beginning of 1970 and are stored using four bytes. and time considered only time interval.

      Comment

      Working...