At 7:48 PM +0200 1999-12-23, Ott Kaukver wrote:
>Hello!
>
>I'm faced with a problem. Does it have to be like that or my
>knowledge of date types is medium...?
>
>okay. table, field mydate date .
>one record 1965-10-09
>
>When I execute query
>
>SELECT from_unixtime(unix_timestamp(mydate), '%d-%m-%Y') FROM table
>
>then the result is 01-01-1970.
>
>And next query
>
>SELECT mydate,from_unixtime(unix_timestamp(mydate), '%d-%m-%Y') FROM table
>
>then the result is
>
>1965-10-09 01-01-1970
>
>bug or a feature? or my stupidity? RTFM?
Try the latter. UNIX timestamps have a range that begins in 1970.
(The UNIX epoch.) You can't represent dates in 1965 with them.
--
Paul DuBois, paul@stripped