tags:

views:

340

answers:

2

How can i change ex. 2009-01-14 06:38:18 to 2009-01-14 06:38? the column type is DATETIME. i dont wanna use SELECT DATE_FORMAT

how could i do it with php? date("M-d-Y H:i", $userow['regdate']) gives:

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set()

+3  A: 

Use date_default_timezone_set() before, as your error says.

Karsten
A: 

The error message just suggest you specify your timezone so you end up printing the correct date for your intended audience. Other than that, date() expects a timestamp as it's second argument so that's why converting the string MySQL returned to an int with strtotime() definitely helps.

gnrfan