List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:May 22 2001 5:18pm
Subject:Re: UNIX_TIMESTAMP converts to CURRENT_DATE on a second call
View as plain text  

Shankar Unni wrote:

> Sinisa writes:
> 
> 
>> - timestamp is saved in datetime format
>> - first timestamp column is silently updated on each UPDATE
> 
> 
> What this means, of course, is that when you want to deal with your own
> TIMESTAMP data, you need to maintain some sort of sacrificial column (e.g.
> "LAST_UPDATED TIMESTAMP") that can be subjected to this automatic update
> (and must be the first TIMESTAMP column in your table!), so that MySQL
> leaves your other "real" TIMESTAMP columns alone.
> 
> Though really, this behavior should be an *option* (preferably a *per-table*
> option) in MySQL, not an automatic feature (i.e. assuming that any TIMESTAMP
> column must be a "last-updated" type column data). TIMESTAMP is an ANSI type
> with its own defined semantics, and it's perfectly valid to expect that the
> user may want to maintain their own timestamp data without MySQL making any
> assumptions about it..
> 
> 
> --
> Shankar.

What this means is you should be using a DATETIME field instead of a 
timestamp.

-- 
Gerald L. Clark
gerald_clark@stripped

Thread
UNIX_TIMESTAMP converts to CURRENT_DATE on a second callcameron19 May
  • Re: UNIX_TIMESTAMP converts to CURRENT_DATE on a second callSinisa Milivojevic19 May
RE: UNIX_TIMESTAMP converts to CURRENT_DATE on a second callShankar Unni22 May
  • Re: UNIX_TIMESTAMP converts to CURRENT_DATE on a second callGerald Clark22 May