【发布时间】:2012-06-29 12:06:59
【问题描述】:
我正在尝试获取该月第一天 00:00:00 的时间戳。
例如 2012 年 1 月 1 日 00:00:00 的时间戳
我正在这样做:
$test_month = time(); // Seconds
$test_month = date('M', $test_month); // This month
$test_month = strtotime($test_month); // Timestamp of this month
echo $test_month;
这是返回当月当天的零时,而不是月初。
有什么建议吗?
【问题讨论】:
标签: php date timestamp strtotime