Page 2 of 2

php way

Posted: Fri Jan 20, 2006 5:09 pm
by yakasha
If, in the future you really want to do it the php way, remember strtotime() can understand most dates. Including, I think, the one you have. So just:

Code: Select all

$new_date = date("d-m", strtotime($old_date));

Re: php way

Posted: Fri Jan 20, 2006 5:13 pm
by hawleyjr
yakasha wrote:If, in the future you really want to do it the php way, remember strtotime() can understand most dates. Including, I think, the one you have. So just:

Code: Select all

$new_date = date("d-m", strtotime($old_date));
Why do you say that? MySQL will do it just fine.