Parsing Twitter API Datestamp(解析 Twitter API 日期戳)
问题描述
我正在使用 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 日期戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:解析 Twitter API 日期戳
基础教程推荐
- 在多维数组中查找最大值 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01