|
Posted by Michael Fesser on 06/21/07 16:00
..oO(mantrid)
>Is it best to do that in Excel or use a php date format function?
>In Excel it is dd/mm/yyy
>but it wont allow me to save as a CVS file in the form yyy-mm-dd hh:mm:ss,
>it just changes it back.
>ive tried DATE_FORMAT('".$dateandtime."','%Y-%m-%d %H:%i:%s') in the sql
>statement but its not working, am I using this function wrongly?
Yep, but doesn't matter in this case.
>Do you know a php function that does a similar thing? I know the date format
>characters (eg d M Y etc) but can only see examples of their use with
>date(), which is the current date, not a date from my CVS file.
Try strtotime(). If it doesn't work as expected (for example dd/mm/yyyy
vs. mm/dd/yyyy), use string functions to split the Excel date and create
your own date string in MySQL format.
Micha
Navigation:
[Reply to this message]
|