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

从Datetime获取日期字符串[复制]

This question already has an answer here:

  • convert strtotime to date time format in php 5 answers

This is my String Tue, 20 Aug 2013 10:45:05 and i want to this string in Date Format Like this :

2013-08-20.

Guys Please help.

Thanks

</div>

Try this,

$d=date('Y-m-d',strtotime('Tue, 20 Aug 2013 10:45:05'));
echo $d;

Something like this:

echo date('Y-m-d', strtotime('Tue, 20 Aug 2013 10:45:05'));

近期文章

  • Android - PHP或Java Webservice [关闭]
  • PHP解析错误:语法错误,第13行/root/Desktop/generator/dump.php中的意外T_VARIABLE [重复]
  • 我该如何修复php函数bool? [关闭]
  • 使用imap函数向已发送邮件添加附件
  • 在jquery中单击复选框时如何将会话值获取到文本框
  • joomla在哪里存储页面标题? 在DB? 什么表? [关闭]
  • 将php foreach循环的结果存储为数组
  • 如何替换session_register(“adminuser”); 与$ _SESSION? 更多信息如下
  • 为什么我的echo在头函数头之前不起作用(location:home.php);
  • 这些运算符之间有什么区别=和=&
  • 我应该让php处理它或将所有数据转储到数据库[关闭]
  • PHP在字符之前和字符之后提取字符串
  • 检查帖子“前”时间[重复]
  • 功能的含义
  • 回声单个数组值[关闭]
  • 数据库未更新[关闭]
  • Wordpress问题[关闭]
  • 从文本中提取两个值[关闭]
  • 为什么它只返回一行?
  • 浏览器栏中的网站自毁

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华