|
Posted by G-Rod on 03/13/07 22:39
I use this for standard dates (e.g. 12-21-07)
function changeToMySqlDate($caldate){
if($caldate == ""){
return "1969-12-31";
} else {
$caldate = date('Y-m-d', strtotime($caldate));
return $caldate;
}
}
On Mar 11, 2:51 pm, fox.whis...@virgin.net wrote:
> >On 1/16/07 10:53, in article 7174d$45ad1f4a$3ec25048$9...@news.chello.nl,
> >"hennie" <h.w.jan...@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
>
> As long as your input is numerical, you've just done it!
[Back to original message]
|