If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > info about MySQL's TIMESTAMP columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-07-08, 05:42
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
info about MySQL's TIMESTAMP columns

Hi to all,

I tried using TIMESTAMP columns on my MySQL tables and having read MySQL's
documentation regarding about the DATE data types, especially on TIMESTAMP's,
that its max value is only up to 2037 (maybe for now).

I tried changing my PC's date to the year '2038' and above, and begin
inserting records in a table with TIMESTAMP columns, which have
CURRENT_TIMESTAMP as its default value, and noticed that instead of inserting the current TIMESTAMP, it inserted the value '2000-01-00'.

I tried running a SELECT query to view those records in MySQL's Query Browser
(current date of PC is still greater than 2037) and it did return records and
then disappeared, like it just "flashed" in the grid. I tried running the
query again in the MySQL console, and that is where I saw the '2000-01-00'
value.

I have not yet checked MySQL's site for this issue and have not checked the
new version of MySQL.

By the way I am using version 5.0.27-community-nt.

What will happen if you have an application that can reach the year 2037? I
am currently implementing TIMESTAMPS on my applications that uses MySQL as
backend...I wonder how can this be resolved?

Thanks and god bless.
__________________
Programming is fun!
Reply With Quote
  #2 (permalink)  
Old 05-07-08, 06:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
use DATETIME instead, because that will allow values up until '9999-12-31'

i guarantee that your application will no longer be running by then

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-07-08, 20:20
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
I am testing TIMESTAMPS in my tables to help control concurrent updates and check if someone updated a row in the table. Since TIMESTAMP has its limit, are there other ways?

DATETIME is good enough?

thanks
__________________
Programming is fun!

Last edited by Panoy; 05-07-08 at 20:36.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On