- Fixed Datetime output

This commit is contained in:
Dave M. 2020-02-10 15:19:46 -05:00
parent 2f43fb4559
commit 8a16ab8062
1 changed files with 12 additions and 10 deletions

View File

@ -6,6 +6,8 @@ use Ulmus\Entity\EntityObjectInterface;
class Datetime extends \DateTime implements EntityObjectInterface {
public string $format = "Y-m-d H:i:s";
public function load(...$arguments)
{
$value = $arguments[0];
@ -20,12 +22,12 @@ class Datetime extends \DateTime implements EntityObjectInterface {
public function save()
{
return $this->getTimestamp();
return $this->__toString();
}
public function __toString()
{
return $this->format("Y-m-d H:i:s");
return $this->format($this->format);
}
}