Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-15 22:27:23 +0300
committerJoas Schilling <coding@schilljs.com>2021-04-15 22:27:23 +0300
commit267dd9c03617ebefc0ca0cd2c4d51e67120121d9 (patch)
tree766868255a68442ff5e58b97d463eea71d00a7bb /lib
parentcbfee7b4444a4e3921d78f2cff7a181f7ef5f709 (diff)
Get DateTime object from ITimeFactory
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/APIController.php6
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 !== '') {