Let's say I have an simple SQL query:
the now() function (not sure if it is a function, I found no documentation of it on php.net) is giving me this:
2002-07-05 18:03:28
But I want to convert this date to an european date/time like this:
05-07-2002 18:03:28
How can I convert this? is there a function for this orso?
Or maybe I must insert the date/time like this:
$date_time = date("d-m-Y H:i:s");
into my database?
But if I do it that way, I can't order my SQL query by the time/date en with now() I can ORDER BY date_time.
That's my point, I want to ORDER BY date_time, but on the page itself my visitors must read a ''good'' european time.
Any ideas for this?
Robbie.
PHP Code:
INSERT INTO news (id,subject,date_time) VALUES ('','$subject',now());
2002-07-05 18:03:28
But I want to convert this date to an european date/time like this:
05-07-2002 18:03:28
How can I convert this? is there a function for this orso?
Or maybe I must insert the date/time like this:
$date_time = date("d-m-Y H:i:s");
into my database?
But if I do it that way, I can't order my SQL query by the time/date en with now() I can ORDER BY date_time.
That's my point, I want to ORDER BY date_time, but on the page itself my visitors must read a ''good'' european time.
Any ideas for this?
Robbie.
Comment