From 9f7c5defaa1d082bda9af99dfc84d08e3e512ca5 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Tue, 5 Apr 2022 15:38:05 +0100 Subject: [PATCH] fix: notification timestamp mismatch in specific configurations (#3379) When app's PHP server's timezone is not set to UTC, which would normally be done by Flarum's bootstrapping process, this call to Carbon would return a different timestamp to other calls elsewhere in Flarum, causing issues with notifications seemingly being delivered too early/late rather than at the actual time they were triggered. --- framework/core/src/Notification/Notification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/src/Notification/Notification.php b/framework/core/src/Notification/Notification.php index e48ad08ba..4d81e5dbe 100644 --- a/framework/core/src/Notification/Notification.php +++ b/framework/core/src/Notification/Notification.php @@ -221,7 +221,7 @@ class Notification extends AbstractModel public static function notify(array $recipients, BlueprintInterface $blueprint) { $attributes = static::getBlueprintAttributes($blueprint); - $now = Carbon::now('utc')->toDateTimeString(); + $now = Carbon::now()->toDateTimeString(); static::insert( array_map(function (User $user) use ($attributes, $now) {