我有以下函数,它应该只将周数添加到开始日期并返回结束日期,但是对于大于 20 的值,我得到错误的结束日期,
例如
开始日期='2013-05-30'
interval_term=24;
将返回为
结束日期:2013-11-07
功能如下,
public function calculateArrangementEndDate($interval_term=12,$start_date=false)
{
$end_date=($start_date===false)?time():strtotime($start_date);
return date("Y-m-d",($end_date+($interval_term-1)*3600*7*24));
}
但从 start_date 算起的正确 24 周是 2013-10-31
像这样
付款时间表:
Due Date Amount
30/05/2013 $0.64
06/06/2013 $0.64
13/06/2013 $0.64
20/06/2013 $0.64
27/06/2013 $0.64
04/07/2013 $0.64
11/07/2013 $0.64
18/07/2013 $0.64
25/07/2013 $0.64
01/08/2013 $0.64
08/08/2013 $0.64
15/08/2013 $0.64
22/08/2013 $0.64
29/08/2013 $0.64
05/09/2013 $0.64
12/09/2013 $0.64
19/09/2013 $0.64
26/09/2013 $0.64
03/10/2013 $0.64
10/10/2013 $0.64
17/10/2013 $0.64
24/10/2013 $0.64
31/10/2013 $0.64