1

我的日期格式如下:

$datum = date("d.m.Y", strtotime(osC_DateTime::getShort($this->_order->getInvoiceDate())));

它显示:15.04.2012 我怎样才能到达那里 + 4 天?

4

4 回答 4

1

这是正确的

$date = osC_DateTime::getShort($this->_order->getInvoiceDate());

$datum = date("d.m.Y", strtotime("$date + 4 day"));
于 2012-04-17T19:55:40.787 回答
1
$newdate = date("d.m.Y", strtotime ( '+4 day' , strtotime ( $datum ) )) ;
于 2012-04-17T19:56:08.530 回答
0
$shortDate = osC_DateTime::getShort($this->_order->getInvoiceDate());

$datum = date("d.m.Y", strtotime($shortDate +4 day));
于 2012-04-17T19:54:22.883 回答
0

您可以简单地将秒数添加到生成的时间戳。

$timestamp = strtotime(osC_DateTime::getShort($this->_order->getInvoiceDate()));
$datum = date("d.m.Y", $timestamp + 4 * 24 * 60 * 60); // add 4 days
于 2012-04-17T19:56:33.023 回答