Fix to date properties when set as a formatted string

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@63424 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2010-11-07 16:08:27 +00:00
parent 98e7fa5a6a
commit b818187d3c
1 changed files with 278 additions and 264 deletions

View File

@ -199,7 +199,14 @@ class PHPExcel_DocumentProperties
public function setCreated($pValue = null) { public function setCreated($pValue = null) {
if (is_null($pValue)) { if (is_null($pValue)) {
$pValue = time(); $pValue = time();
} elseif (is_string($pValue)) {
if (is_numeric($pValue)) {
$pValue = intval($pValue);
} else {
$pValue = strtotime($pValue);
} }
}
$this->_created = $pValue; $this->_created = $pValue;
return $this; return $this;
} }
@ -222,7 +229,14 @@ class PHPExcel_DocumentProperties
public function setModified($pValue = null) { public function setModified($pValue = null) {
if (is_null($pValue)) { if (is_null($pValue)) {
$pValue = time(); $pValue = time();
} elseif (is_string($pValue)) {
if (is_numeric($pValue)) {
$pValue = intval($pValue);
} else {
$pValue = strtotime($pValue);
} }
}
$this->_modified = $pValue; $this->_modified = $pValue;
return $this; return $this;
} }