-2

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

peter.petrov
  • 36,377
  • 12
  • 75
  • 137

3 Answers3

1

Yes. According to joda, the first millisecond in UTC can be represented in this format: 1970-01-01T00:00:00Z

deltastar
  • 45
  • 2
  • 10
1

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

ISO 8601

StackExchange

1

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

deHaar
  • 14,698
  • 10
  • 35
  • 45