Java

Java

Made by DeepSource

ZoneId.of("Z") should be replaced with ZoneOffset.UTC JAVA-W1085

Anti-pattern
Major
Autofix

Avoid calling ZoneId.of() to get the UTC timezone offset, and instead use ZoneOffset.UTC directly.

Bad Practice

ZoneId utc = ZoneId.of("Z");

Recommended

ZoneId utc = ZoneOffset.UTC;

References