diff --git a/CHANGES.md b/CHANGES.md index 5103e39a11..a6fa76fff7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ # Version 1.2.1 ## Bugs - Fix a few null safety warnings [#4654](https://github.com/appwrite/appwrite/pull/4654) +- Fix timestamp format in Realtime response [#4515](https://github.com/appwrite/appwrite/pull/4515) # Version 1.2.0 ## Features diff --git a/app/realtime.php b/app/realtime.php index ac4e2d669a..c957a64c4c 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -237,7 +237,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['stats.connections'], 'channels' => ['project'], - 'timestamp' => DateTime::now(), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => [ $projectId => $payload[$projectId] ] @@ -264,7 +264,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, 'data' => [ 'events' => ['test.event'], 'channels' => ['tests'], - 'timestamp' => DateTime::now(), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => $payload ] ]; diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index dddbc59e7f..e37d9ace77 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -149,7 +149,7 @@ class Realtime extends Adapter 'data' => [ 'events' => $events, 'channels' => $channels, - 'timestamp' => DateTime::now(), + 'timestamp' => DateTime::formatTz(DateTime::now()), 'payload' => $payload ] ]));