How can I get the current date and time in UTC or GMT in Java?

When I create a new Date object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?

33 s
33

Leave a Comment