我需要檢索從當前日期時間+某段時間開始的過期日期時間。PHP-如何檢索到期日期時間
的例子是:
$current_datetime = date('Y-m-d H:m:s');
$expire_time = 24;// 1 day in hours as int() for example ;)
$expire_datetime = date($current_datetime + $expire_time); //don't know how to do this in Y-m-d H:m:s format!!
我想寫下的幫手LIB從這個腳本啓動。
http://php.net/manual/en/datetime.add.php http://stackoverflow.com/questions/ 985818/php-date-time-current-time-add-minutes http://stackoverflow.com/questions/2242601/add-days-and-hours-in-date-time-field-and-get-the-updated -date-time-in-php-using http://stackoverflow.com/questions/7811609/php-add-two-hours-to-date-variable – Bugs
或['strtotime'](http:// www .php.net/manual/en/function.strtotime.php) – air4x