List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 18 2003 4:49pm
Subject:Stalking the wily 8-byte DATETIME !!
View as plain text  
Pursuant to last week's discussion of why, if DATE and TIME each take
three bytes, does DATETIME take eight bytes, I found the following in
the internals.texi document:

@strong{DATE}
@itemize @bullet
@item
Storage: fixed-length series of binary integers, always three bytes
long.
@item
Example: a DATE column containing '0001-01-01' looks like:@*
@code{hexadecimal 21 02 00}
@end itemize

@strong{DATETIME}
@itemize @bullet
@item
Storage: eight bytes.
@item
Part 1 is a 32-bit integer containing year*10000 + month*100 + day.
@item
Part 2 is a 32-bit integer containing hour*10000 + minute*100 + second.
@item
Example: a DATETIME column for '0001-01-01 01:01:01' looks like:@*
@code{hexadecimal B5 2E 11 5A 02 00 00 00}
@end itemize

@strong{TIME}
@itemize @bullet
@item
Storage: a value offset from 8385959, always three bytes long.
@item
Example: a TIME column containing '01:01:01' looks like:@*
@code{hexadecimal 75 27 00}
@end itemize

-- 
Paul DuBois
http://www.kitebird.com/
sql, query
Thread
Stalking the wily 8-byte DATETIME !!Paul DuBois18 Mar
  • Re: Stalking the wily 8-byte DATETIME !!Keith C. Ivey18 Mar