開始日 (タイムスタンプ) と終了日 (タイムスタンプ) の MySQL 列と、paying_period (3 か月または 6 か月) の 3 番目の列があります。
例: 開始日は1-jan-2012
、終了日は1-jan-2013
です。, like 1st installment goes on
2012 年 3 月1 日、2012 年6 月 1 日などの3 か月の期間が必要です,2nd on
。
どうすればできますか?
DateTimeで日付の操作が簡単に
$date = new DateTime('1-jan-2012'); // Start date
$date->modify('+3 months'); // 3 months later
echo $date->getTimestamp(); // timestamp
$date->modify('+3 months'); // 6 mnths later
echo $date->getTimestamp(); // timestamp
$date->modify('+3 months'); // 9 months later
echo $date->getTimestamp(); // timestamp