dongzhi1822 2017-03-10 11:06
浏览 38
已采纳

在PHP中插入当前时间时出错

I want to insert current date and time when i add new record. But when i theres a problem. The date was correct but the time error. This is the code:

<?php echo date('d-m-Y H:i:s A',strtotime($value['Province']['created']));?>

When i add new data at 10/03/2017 18:40 PM, Then output will be 10/03/2017 11:41 Am. The time was wrong. created is column name in table Province in database

  • 写回答

2条回答 默认 最新

  • dongpa3109 2017-03-10 11:10
    关注

    Check this

    In the config/core.php file of the app folder try the following with single quotes:

    // Replace with your timezone ex. ('Asia/Kolkata') or
    date_default_timezone_set('Australia/Melbourne');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制