The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

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.

Convert date to datetime and output date_format

Well, I am attempting to update a error I receive with a date in a mysql table.
The table is and I am told to switch to datetime. The error I keep getting is the table does not index the logs and the select grabs a date from one log and a time from another.

1) why do you have a tab between the date and time? A space is sufficient.

2) Mixing and matching timezone information is going to lead to confusion. Typically, I store all of my datetimes in server time or GMT (depending on the app) since that will be consistent. When I access the data, I then adjust for the client's timezone if needed. In your case, I would drop P from the date format and drop the + $zone also. When you select the date, that's when you use the $zone adjustment (before displaying).