我正在使用 twitter API 返回状态更新列表及其创建时间.它以以下格式返回创建日期:
I'm using the twitter API to return a list of status updates and the times they were created. It's returning the creation date in the following format:
2010 年 4 月 9 日星期五 12:53:54 +0000
Fri Apr 09 12:53:54 +0000 2010
将其格式化为 09-04-2010 的最简单方法是什么(使用 PHP 或 Javascript)?
What's the simplest way (with PHP or Javascript) to format this like 09-04-2010?
strtotime("dateString"); 把它变成原生 PHP 日期格式,然后就可以使用 date() 函数打印出你想要的方式.
strtotime("dateString"); gets it into the native PHP date format, then you can work with the date() function to get it printed out how you'd like it.
这篇关于解析 Twitter API 日期戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
以编程方式将可下载文件添加到 Woocommerce 产品Add programmatically a downloadable file to Woocommerce products(以编程方式将可下载文件添加到 Woocommerce 产品)
获取今天 Woocommerce 中每种产品的总订单数Get today#39;s total orders count for each product in Woocommerce(获取今天 Woocommerce 中每种产品的总订单数)
在 WooCommerce 和电话字段验证问题中添加自定义注Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和电话字段验证问题中添加自定义注册字段
在 Woocommerce 简单产品中添加一个将更改价格的选Add a select field that will change price in Woocommerce simple products(在 Woocommerce 简单产品中添加一个将更改价格的选择字段)
在 WooCommerce 3 中将自定义列添加到管理产品列表Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中将自定义列添加到管理产品列表)
自定义结帐“下订单"按钮输出htmlCustomizing checkout quot;Place Orderquot; button output html(自定义结帐“下订单按钮输出html)