I have a date string as below.
I think this implies it is in UTC timezone.
Is that correct?
2016-10-30T15:27:02.000Z
I have a date string as below.
I think this implies it is in UTC timezone.
Is that correct?
2016-10-30T15:27:02.000Z
You correctly guessed it, thats UTC Date and Time.
ISO 8601
Which is October 30th, 2016, at 3:27 pm (+2 seconds) in Greenwich Mean Time.
For further reference you can check
Yes, you can verify it by parsing a java.time.ZonedDateTime
from the String
and print the offset information of it:
public static void main(String[] args) {
String utcDateTime = "2016-10-30T15:27:02.000Z";
ZonedDateTime zdt = ZonedDateTime.parse(utcDateTime);
System.out.println(zdt.format(DateTimeFormatter
.ofPattern("uuuu-MM-dd HH:mm:ss zzz '==>' xxx '=' O")));
}
This outputs
2016-10-30 15:27:02 Z ==> +00:00 = GMT
Note: This output pattern contains redundant information for verification, see the pattern letters in the JavaDocs of java.time.format.DateTimeFormatter