当前位置:网站首页>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边栏推荐
- Flink Exception -- No ExecutorFactory found to execute the application
- 技术管理进阶——管理者如何进行梯队设计及建设
- Graffiti Wi Fi & ble SoC development slide strip
- CUDA implements matrix replication
- [kotlin collaboration process] complete the advanced kotlin collaboration process
- Mmcv expanding CUDA operator beginner level chapter
- 2021-05-06
- How can we get a satisfactory salary? These routines still need to be mastered
- Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
- Is it safe to open an account? How can anyone say that it is not reliable.
猜你喜欢
Enhance the add / delete operation of for loop & iterator delete collection elements
基于Svelte3.x桌面端UI组件库Svelte UI
Redis design and Implementation (IV) | master-slave replication
[kotlin collaboration process] complete the advanced kotlin collaboration process
将线程绑定在某个具体的CPU逻辑内核上运行
[nvme2.0b 14-8] set features (Part 2)
Gilbert Strang's course notes on linear algebra - Lesson 3
C accesses mongodb and performs CRUD operations
Swagger use
增强for循环的增删操作 & 迭代器删除集合元素
随机推荐
Is it safe to open an account? How can anyone say that it is not reliable.
Interference source current spectrum test of current probe
Summary of common pytoch APIs
Introduction to MySQL basics day3 power node [Lao Du] class notes
使用华为性能管理服务,按需配置采样率
Flink Exception -- No ExecutorFactory found to execute the application
启动jar包报错UnsupportedClassVersionError,如何修复
Detectron2 source code reading 2--- using the configurable decorator to build the dataloader
Enter the URL in the browser and display it on the page
Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
在浏览器输入url到页面展示出来
Deploy the cow like customer network project on the ECS
Advanced technology management -- how managers design and build echelons
【NVMe2.0b 14-2】Create/Delete Queue
Redis设计与实现(七)| 发布 & 订阅
Self made GIF dynamic graph -gifcam
Emoji icons supported by markdown
Unity basic lighting model
Does the oscilloscope probe affect the measurement of capacitive load?
MIME type Encyclopedia