You are here: Re: Convert text to mysql date format « PHP SQL « IT news, forums, messages
Re: Convert text to mysql date format

Posted by Christopher Ames on 03/11/07 06:06

Try using the PHP strtotime() function to make a UNIXTIME date, then convert
from that on the MySql side using FROMUNIXTIME (or something). StrToTime()
is a great function. Get something close to a date format and it uses it.

On 1/16/07 10:53, in article 7174d$45ad1f4a$3ec25048$9670@news.chello.nl,
"hennie" <h.w.jansen@haarlem-nh.nl> wrote:

> How can i convert a date in text format into a date format that is accepted
> by msql?
>
> I have 3 values for day, month and year
>
> I combine them to a date string $date1=$year."-".$month."-".$day;
>
> How do i go further to make $date1 suitable for mysql?
>
> Thanks in advance, Hennie
>
>

 

Navigation:

[Reply to this 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

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