diff --git a/GrpcTrait.php b/GrpcTrait.php index 355feee..7fe3c45 100644 --- a/GrpcTrait.php +++ b/GrpcTrait.php @@ -251,7 +251,7 @@ private function formatTimestampForApi($value) { preg_match('/\.(\d{1,9})Z/', $value, $matches); $value = preg_replace('/\.(\d{1,9})Z/', '.000000Z', $value); - $dt = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', $value); + $dt = \DateTimeImmutable::createFromFormat('Y-m-d\TH:i:s.u\Z', $value, new \DateTimeZone('UTC')); $nanos = (isset($matches[1])) ? str_pad($matches[1], 9, '0') : 0; return [