Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 var $date_ordered,它给了我以下字符串:“2013-07-02 07:48:06”我希望 php 将其识别为日期,以以下格式输入:“2013-07-02T07 :48:06+0100" 再加上 48 小时。
我该怎么做呢?
亲切的问候
将您的日期转换为时间,添加 48 小时,然后转换为 ISO 8601(这似乎是您想要的):
$a = '2013-07-02 07:48:06'; $time = strtotime($a); $time += 48 * 60 * 60; echo date(DATE_ISO8601, $time) . PHP_EOL;