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.
我在数据库中有一个 TIMESTAMP 用于页面,所以采用这种格式$d="2011-01-03 12:53:22"
$d="2011-01-03 12:53:22"
当我尝试发送它时,date("c",$d)我只会得到1970-01-01T10:33:31+10:00
date("c",$d)
1970-01-01T10:33:31+10:00
我在 php 手册中读过 date("c",THIS) 必须是一个 INT 那么我用什么来从“2011-01-03 12:53:22”获取 int ?
发送日期函数时忘记将日期字符串转换为时间戳
date('c', strtotime($d));