日光節約時間的陷阱
在 PHP 上面計算當前時間之後一週的時間,以 Timestamp 來計算
<?php
$now = time();
$next_week = $now + 7 \* 86400;
<?php
$next_week = strtotime('+ 1 week');
<?php
$date = new DateTime();
$date->add(new DateInterval('P1W'));
$date->format('Y-m-d');
在 PHP 上面計算當前時間之後一週的時間,以 Timestamp 來計算
<?php
$now = time();
$next_week = $now + 7 \* 86400;
<?php
$next_week = strtotime('+ 1 week');
<?php
$date = new DateTime();
$date->add(new DateInterval('P1W'));
$date->format('Y-m-d');