1 | initial version |
In Java, the method to obtain the current date and time in UTC or GMT is as follows:
Instant.now().toString()
This method returns a string representing the current date and time in UTC/GMT timezone in the ISO-8601 date and time format. The Instant
class is used to represent a point in time on the time-line in UTC.