Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007

    Unanswered: 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'

    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!

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    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 | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2007
    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?

    Last edited by Panoy; 05-07-08 at 21:36.
    Programming is fun!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts