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

如果只使用日期,PHP DateTime避免设置语言环境

I'm using PHP DateTime with TimeZone to show time of an specific region. The problem is when I only work with dates, the DateTime object set time to now and when TimeZone is set the date changes +1day or -1day.

If I only work with dates, those shouldn't change.

How to avoid this using DateTime or another PHP object? (creating a custom Date object is a known solution).

I suppose lots of frameworks use internationalization and solve this problem. But how?

近期文章

  • 如何将新页面添加到laravel框架的管理视图中
  • 在iframe和主页之间安全地交换数据
  • Volley Server错误(需要javascript?)Android开发
  • 无法通过Gmail发送电子邮件
  • Woocommerce - 根据变化列出产品
  • 复选框选择JavaScript以显示后端php所需的结果
  • 将PHP MongoDb驱动程序从mongo v1.6.12升级到mongodb v1.4时出错
  • 如何解析Magento SOAP V1 Php类别树
  • 使用htaccess进行mod-write动态链接不起作用
  • 密码检索系统不发送电子邮件codeigniter
  • 优化与MySQL查询的慢速匹配
  • WordPress:需要更改RSS Feed中的帖子永久链接URL
  • 在phpMyAdmin中自动化MySQL
  • 登录失败时请勿刷新
  • 从Android到PHP的POST LineString
  • Laravel 5.2删除Job中的队列
  • Laravel将json传递给vue.js
  • Wordpress时间线显示帖子每月
  • Codeigniter - PHP CSV文件上传
  • 使用rest api创建post wordpress.com

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华