Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 29, 2006, 9:42 pm
rate this thread
stored as text strings, like:
September 29, 2006, 5:13 pm EDT
The first thing I want to do is translate this column to a new one that properly
uses datetime format. I can easily do it via PHP, but as a curiosity I thought
I'd try to accomplish it in MySQL alone.
It looks like STR_TO_DATE will do the trick, but can't come up with the correct
MySQL 4.1.20 UPDATE syntax. Anyone have an idea?
Re: SETting a datetime field based on a text field
Perfect. Thanks very much, Peter. I was trying to make it unnecessarily
complex. This worked straight away, and ignored the time zone suffix as I
UPDATE tablename SET date_new = STR_TO_DATE(date_old, '%M %e, %Y, %l:%i %p');
October 12, 2004, 2:13 pm EDT
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum