Working on a (REST) interface between JavaScript and a database needs to take care of the problem of the time zone info. In JavaScript JSON.stringify() will convert all dates to UTC. Makes sense. If we receive and decode this on in the PHP realm we should explicitly say so and altought null indicates the configured locale timezone although I do believe that more often than not no timezone is configured in PHP. So better be save than sorry and prevent you to miss your flight:
<?php
$jsonString = '{ "date": "2025-05-04T11:58:37.848Z" }';
$dateString = json_decode($jsonString, true)['date']; $d = new \DateTimeImmutable($dateString, new \DateTimeZone('UTC')); $databaseZone = new \DateTimeZone("Europe/Zurich");
$d = $d->setTimeZone( $databaseZone ); var_dump($d);
?>