我的日期格式如下:
$datum = date("d.m.Y", strtotime(osC_DateTime::getShort($this->_order->getInvoiceDate())));
它显示:15.04.2012 我怎样才能到达那里 + 4 天?
这是正确的
$date = osC_DateTime::getShort($this->_order->getInvoiceDate());
$datum = date("d.m.Y", strtotime("$date + 4 day"));
$newdate = date("d.m.Y", strtotime ( '+4 day' , strtotime ( $datum ) )) ;
$shortDate = osC_DateTime::getShort($this->_order->getInvoiceDate());
$datum = date("d.m.Y", strtotime($shortDate +4 day));
您可以简单地将秒数添加到生成的时间戳。
$timestamp = strtotime(osC_DateTime::getShort($this->_order->getInvoiceDate()));
$datum = date("d.m.Y", $timestamp + 4 * 24 * 60 * 60); // add 4 days