开发者

PHP strtotime date today, which is better?

I was wondering if one method is better than the other when it comes to getting the timestamp of the date today.

Which 开发者_C百科is better?

$timestamp = strtotime("now");

or

$date_today = date("Y-m-d H:i:s");
$timestamp = strtotime($date_today);

Is there even a difference?

Thanks!!!!


Neither. You should use time().


They're both sub-optimal (but trivially so in almost every case).

Try:

<?PHP
$timestamp = time();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜