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

如何使用带保留字的日期功能?

Need to know how can I simply use the date function with a reserved word?

See this code:

echo date("Y-m-dTH:i:s"); // "2012-08-24EST12:35:46" -> It's wrong.

echo date("Y-m-d")."T".date("H:i:s"); // It's correct, But Not my style.

I want to get this string 2012-08-23T14:01:02, but When I use T in the FORMAT string. The result is not what I want. (Because T is reserve word)

How to use T string with date function?

You could escape them with \.

echo date('Y-m-d\TH:i:s');

近期文章

  • 在.htm扩展文件上处理PHP代码? [重复]
  • 如何从电子邮件表单“从”字段中删除服务器?
  • 使用PHP创建Windows媒体播放器播放列表
  • 怎么获取当前标签的值
  • unity如何实现游戏中的蹲起嘲讽
  • 编译器提示 ios sflags 未声明,可是我已经写过 #include <iomanip>了 .书上没找到原因.
  • c++编程排序问题,不知道错在哪无法正常排序,无显示。
  • MySQL函数返回很难在PHP中使用结果
  • 从Percent Encoded URL参数中获取正确的UTF-8字符
  • 我需要迭代一个JSON数组 - 不知道该怎么做 - 已搜索但仍无法得到线索
  • PDO不插入值
  • 将MYSQL查询转换为PHP Query
  • PHP以多种形式保存sql中的数据
  • 在提交之前修改$ _POST变量
  • 如何暂停新发布的记录?
  • 处理表单时的url格式
  • php PDO UPDATE语句:哪个更安全?
  • 正在加载第三方库:未找到
  • 检索Array中给定子键的所有父键
  • 在php中手动超时后会话初始化

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华