diff options
author | Joas Schilling <coding@schilljs.com> | 2021-04-15 22:27:23 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-04-15 22:27:23 +0300 |
commit | 267dd9c03617ebefc0ca0cd2c4d51e67120121d9 (patch) | |
tree | 766868255a68442ff5e58b97d463eea71d00a7bb /lib | |
parent | cbfee7b4444a4e3921d78f2cff7a181f7ef5f709 (diff) |
Get DateTime object from ITimeFactory
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/APIController.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Controller/APIController.php b/lib/Controller/APIController.php index 07f3d2d..392c2de 100644 --- a/lib/Controller/APIController.php +++ b/lib/Controller/APIController.php @@ -80,15 +80,13 @@ class APIController extends OCSController { } $notification = $this->notificationManager->createNotification(); - $time = $this->timeFactory->getTime(); - $datetime = new \DateTime(); - $datetime->setTimestamp($time); + $datetime = $this->timeFactory->getDateTime(); try { $notification->setApp('admin_notifications') ->setUser($user->getUID()) ->setDateTime($datetime) - ->setObject('admin_notifications', dechex($time)) + ->setObject('admin_notifications', dechex($datetime->getTimestamp())) ->setSubject('ocs', [$shortMessage]); if ($longMessage !== '') { |