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

View File

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