How to print UTC or GMT using SimpleDateFormat?
Advertisements I am trying to print a date in this format: 2023-01-11 09:25:52 UTC But when I use date format: yyyy-MM-dd HH:mm:ss Z I get: 2023-01-11 09:29:25 +0100 >Solution : Use a lowercase z instead of Z to get the offset instead of the id. And you have to set the time zone using simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")).… Read More How to print UTC or GMT using SimpleDateFormat?