MySQL Forums
Forum List  »  Performance

Re: Timestamp vs Datetime
Posted by: Allen Arakaki
Date: July 21, 2005 05:59PM

BTW,

I use DATETIME for just about everything rather than TIMESTAMP. When I update tables, it's just as easy for me to set lastX=NOW(). The only situations I can think of to use TIMESTAMP is if you use FOREIGN KEY CONSTRAINTS ON UPDATE CASCADE - but from my last example, that does not appear to update the TIMESTAMP column. Unless that is a bug, there's probably very little reason to use TIMESTAMP over DATETIME.

I believe there's a bug in the JConnector v3.1.8 RS.getString() method when attempting to retrieve TIMESTAMP values (doesn't happen for DATETIME values) where the string returned isn't in the '0000-00-00 00:00:00' format instead it's something like '0000-00-00 00:00:00:0000' (with extra appended values). I don't remember the bug number, but it only occurs in 4.1.? (they may have fixed it in 4.1.13) and does not happen in 4.0.X. The workaround is RS.getTimestamp() ... if you don't mind using java.util.Date

Options: ReplyQuote


Subject
Views
Written By
Posted
86608
July 17, 2005 05:33PM
47268
July 17, 2005 09:37PM
31973
July 18, 2005 04:51PM
24117
July 21, 2005 05:36PM
Re: Timestamp vs Datetime
55923
July 21, 2005 05:59PM
24060
July 22, 2005 11:41AM
15583
November 21, 2006 01:28PM
15293
November 21, 2006 05:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.