diff options
Diffstat (limited to 'app/class/Page.php')
-rw-r--r-- | app/class/Page.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/class/Page.php b/app/class/Page.php index e4692e3..c30352c 100644 --- a/app/class/Page.php +++ b/app/class/Page.php @@ -444,10 +444,19 @@ class Page extends Dbitem } } + /** + * DateTimeImmutable : set date + * string ISO8601 : set date + * true : reset to now + * + * @param string|DateTimeImmutable|true $datecreation Set or reset date of creation + */ public function setdatecreation($datecreation) { if ($datecreation instanceof DateTimeImmutable) { $this->datecreation = $datecreation; + } elseif ($datecreation === true) { + $this->datecreation = new DateTimeImmutable(null, timezone_open("Europe/Paris")); } else { $this->datecreation = DateTimeImmutable::createFromFormat(DateTime::ISO8601, $datecreation, new DateTimeZone('Europe/Paris')); } |