当前位置:网站首页>How to format an UTC date to use the Z (Zulu) zone designator in php?
How to format an UTC date to use the Z (Zulu) zone designator in php?
2022-06-30 08:42:00 【Saffron】
problem :
I need to display and handle UTC dates in the following format: I need to display and process in the following format UTC date :
2013-06-28T22:15:00Z2013-06-28T22:15:00Z
As this format is part of the ISO8601 standard I have no trouble creating DateTime objects from strings like the one above. Because this format is ISO8601 Part of the standard , So I can easily create... From the above string DateTime object .However I can't find a clean way (meaning no string manipulations like substr and replace, etc.) to present my DateTime object in the desired format. But I can't find a clean way ( It means there is no such thing as substr and replace Wait for string operation ) To display my... In the desired format DateTime object .I tried to tweak the server and php datetime settings, with little success. I try to adjust the server and php Date and time settings , But to little effect .I always get: I always get :
$date->format(DateTime::ISO8601); // gives 2013-06-28T22:15:00+00:00
Is there any date format or configuration setting that will give me the desired string? Is there any date format or configuration setting that can provide me with the required string ?Or I'll have to append the 'Z' manually to a custom time format? Or I have to manually “Z” Attach to custom time format ?
Solution :
Reference resources : https://stackoom.com/en/question/1Ay8W边栏推荐
- Alcohol tester scheme: what principle does the alcohol tester measure alcohol solubility based on?
- 14岁懂社会-《关于“工作的幸福”这件事儿》读书笔记
- Circuit analysis of current probe
- This point in JS
- 云服务器上部署仿牛客网项目
- Redis设计与实现(一)| 数据结构 & 对象
- Axure制作菜单栏效果
- Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
- vite項目require語法兼容問題解决require is not defined
- Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
猜你喜欢
Does the oscilloscope probe affect the measurement of capacitive load?
电流探头电路分析
QT connection to Shentong database
Flink Exception -- No ExecutorFactory found to execute the application
[untitled]
Detectron2 source code reading 4-- registrar construction model
vim 从嫌弃到依赖(21)——跨文件搜索
[untitled]
一次cpu 跌底排查
2021-04-29
随机推荐
小心transmittable-thread-local的这个坑
Redis design and Implementation (III) | interaction between server and client (event IO model)
TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
Comparaison de deux façons d'accéder à la base de données SQL Server (sqldatareader vs sqldataadapter)
基于Svelte3.x桌面端UI组件库Svelte UI
vim 从嫌弃到依赖(21)——跨文件搜索
Tidb 6.0: making Tso more efficient tidb Book rush
Advanced technology management -- how managers design and build echelons
Swagger use
Is it safe to open an account? How can anyone say that it is not reliable.
Qt连接神通数据库
Redis design and Implementation (VIII) | transaction
icon资源
Viteproject require Syntax Compatibility Problem Solving require is not defined
Qt通过Url下载文件
QT downloading files through URL
Introduction to MySQL foundation power node [Lao Du] class assignment
Gilbert Strang's course notes on linear algebra - Lesson 4
国债逆回购绝对安全吗 网上怎么开户
Redis design and Implementation (IV) | master-slave replication