本文介紹了解析 Twitter API 日期戳的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我正在使用 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模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!