| Massimiliano Bariola 2005-03-25, 3:57 pm |
| Justin Patrin wrote:
>On Wed, 23 Mar 2005 17:37:31 +0100, Massimiliano Bariola
><m.bariola@prodigiweb.it> wrote:
>
>
>
>The problem is likely that it's coming through as a number and DB_DO
>is seeing it as a number. Doing ''.$anag->DataNascita makes it a
>string. It would be better to use (string)($anag->DataNascita). I know
>this is longer, but it states your intentions better.
>
>You can also insert dates as "YYYY-MM-DD HH:II:SS" into mysql, and I
>prefer these. I would suggest you use this format for inserting if you
>can. Note: Mysql TIMESTAMPs are in YYYYMMDDHHIISS format, which is
>more like what you're describing.
>
>
>
Sorry for taking so long to answer. No, I really wanted to take
advantage of mySQL's ability to convert a YYYYMMDD( HH:II:SS) -
formatted number or string to the human-readble DATE/DATETIME form. Only
that DBDO seems to correctly do it if the initial field is a string
(sorry for the example above which does not show the real string -- it
should have been '20050323' and not '2005-03-23').
The fact is that my original database dump contains datetimes as
YYYYMMDDHHIISS integers, so I didn't want to format the original records
to the YYYY-MM-DD HH:II:SS form on-the-fly. I am a lazy guy and besides,
MySQL is more than capable of converting it by itself, even when
starting from integers and not strings ;)
So, DBDO works on a YYYYMMDDHHIISS string but not on a
similarly-formatted integer - while mySQL does.
I felt it's something that maybe should be addressed in future releases
of DBDO.
Happy Easter to everybody!
|