文章:published_time日期格式

orh*_*hun 2 php time datetime date

我通过php time()格式在mysql中保存日期..例如:1407178292

如何将它转换为架构/文章的日期时间:meta标签上的published_time?

<meta property="article:published_time" content="??" />
Run Code Online (Sandbox Code Playgroud)

我在网上看到的所有样品都是这样的:

<meta property="article:published_time" content="2013-11-12T19:57:40+00:00" />
Run Code Online (Sandbox Code Playgroud)

我的意思是:我必须将time()格式转换为2013-11-12T19:57:40 + 00:00等.

而且,我可以/应该在NewsArticle中使用published_time吗?

有人能帮助我吗?

Joh*_*nde 8

c格式选项date()是你在找什么

 $date = date('c', 1407178292); // the timestamp is the second parameter
Run Code Online (Sandbox Code Playgroud)