Reply to Re: using php to move rows from text file into mysql table

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация