1.date_default_timezone_set('Etc/GMT-8'); 设置php 时间
在调用时间函数前先使用这个;
如
$ly_con = $_POST['ly_con']; date_default_timezone_set('Etc/GMT-8'); $ly_tm = date("Y-m-d H:i:s");
然后存入数据库的就是服务器时间了~~
2.能修改php.ini。打开php.ini查找date.timezone 去掉前面的分号
3.据说date_default_timezone_set ("Asia/Sanghai"); 在程序开始加这么一句也可以,但是测试不行啊~~