我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

包含wordpress后,PHP datetime()返回一小时的时间 - 修复?

I just found out that if I call datetime() regulary it returns correct time,
but when I call it after including wordpress (include('wp-load.php');) the datetime() starts to return one hour less time (UTC time).

Wordpress is set to UTC+1. So how do I fix this problem?

Perhaps there are timezone setting somewhere in wp-load.php

http://www.php.net/manual/en/function.date-default-timezone-set.php

You may declare timezone in your script or change timezone somewhere in included script (quess it is wordpress).

近期文章

  • 简单的PHP 5.4会话上传进度数据不在会话变量中
  • 如何根据属性获取标签
  • android应用程序异常关闭
  • 如何从字符串创建数组?
  • 哪个文件调用了另一个?
  • 使用PHP从文本文件中删除空格
  • 无法让PHP在Nginx上运行 - 错误404
  • 你能帮我简化我的ip范围匹配正则表达式吗?
  • 如何在PHP中运行具有多行的MySQL Query?
  • 在帖子视图中显示用户的用户名w /相关评论
  • 检查数据库中是否新创建了表
  • 使用Yii Framework时如何更改/覆盖Gii结果而不必更改Yii Core
  • while while循环中有两个不同的函数?
  • 如何在php中使用数组中的变量参数调用实例变量方法
  • 一种缩短我的URL字符串的方法
  • 没有表三列类别布局
  • 从localhost发送电子邮件?
  • 不同版本的PHP语法错误
  • foreach循环给出意想不到的结果
  • 在计数器达到0之前停止循环

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华