PDA

View Full Version : lỗi mktime() [function.mktime . xử lý thế nào



ff8_khang
03-01-2011, 11:35
tình hình là mình đang cài 1 cái source nhưng gặp phải lỗi mktime() [function.mktime nguyên văn như sau
Strict Standards: mktime() [function.mktime]: 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() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-8.0/no DST' instead in C:\AppServ\www\2\install.php on line 4166

vậy lỗi nầy là thế nào, cách khắc phục ra sao xin các chỉ giúp

truongson1810
04-01-2011, 14:33
Mở file php.ini, tìm dòng date.timezone

set cho nó thành date.timezone = 'Asia/Saigon' là xong

Lý do lỗi : timezone default không được set, mà hàm đó cần timezone, nên php tự động lấy timezone America/Los_Angeles.

Hoặc có thể set trong code bằng hàm date_default_timezone_set(), nhưng tốt nhất là cứ sửa php.ini cho khỏe.

Goodluck!