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();
精彩评论