Which MySql Format for Date & DateAndTime

Hi guys,

I got 2 Newbie question for you:

  1. If I want to save just a DATE (2009/01/10)in a mySql Database. Which Database ColumnType is best for it? DATE??????

  2. If I want to save a DateTime ( 2009/01/10 - 10hours2minutes20seconds) which format shall I when declaring the table in mysql? Datetime?

Will Yii be able to handle both in combination with innoDb MySql?

Thanks for your great support


Hi guys,

does anyone have a tip? I am in the middle of my database design and would like to be sure about how to declare date and timestampsā€¦ I am a but confused because the BLOG demo actually uses INTEGER to save DATEā€¦

Any ideas?

Thanks for your support


I'm using both types (DATE and DATETIME) when needed. You can also use INT fields to store unix timestamps.