View Single Post

   
  #4 (permalink)  
Old 04-29-2008, 08:28 PM
Peter H. Coffin
 
Posts: n/a
Default Re: TIMESTAMP Confusion

On Mon, 28 Apr 2008 15:16:21 -0700 (PDT), macca wrote:
>
>> The ability to read the manual?

>
> Wow! that was just SOOOO helpful!
>
> If you can't say anything constructive, don't say anything at all.
> Ass.
>
> Sometimes it's not immediately apparent why something works the way it
> does. I mean, if I insert NULL into the column it defaults to the
> current timestamp even it I have set the default to '0000-00-00
> 00:00:00', but if i don't insert any data into the column and just
> into the INT column, it defaults to 0000-00-00 00:00:00. I just
> thought it was a bit strange.


Okay, http://dev.mysql.com/doc/refman/5.0/en/timestamp.html

Third paragraph reads: The TIMESTAMP data type offers automatic
initialization and updating. You can choose whether to use these
properties and which column should have them:

followed by several paragraphs about how to use them. Note particularly
the part about the default value being a valid timestamp. "0000-00-00
00:00:00" is not a valid timestamp because there is no month zero nor
day zero. It is also not the special value ts 0, that turns off the auto
stuff.

--
Compared to system administration, being cursed forever is a step up.
-- Paul Tomko
Reply With Quote