0

So I have a time value in the format "20150716203621.000Z", I retrieved from an LDAP server, however I am not sure what the format of this time is in? The ultimate goal is to be able to convert it to a Java.Util.Date Object. Does anyone know what the technical term of this format is? Thanks.

special_cheese
  • 160
  • 1
  • 3
  • 14

3 Answers3

1

It seems to refer to a SimpleDateFormat object. The Z at the end refers to the timezone. See simpledateformat parsing date with 'Z' literal.

Community
  • 1
  • 1
M A
  • 71,713
  • 13
  • 134
  • 174
1

yyyy-mm-ddT00:00:00.000Z

So 20150716203621.000Z is 2015.07.16. 20:36:21 and 000 is milliseconds.

Z means UTC timezone.

Leah
  • 458
  • 3
  • 15
1

This is the standard date/time format as specified in RFC 3339, a profile of ISO 8601.

From RFC :

  date-fullyear   = 4DIGIT
  date-month      = 2DIGIT  ; 01-12
  date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
                             ; month/year
  time-hour       = 2DIGIT  ; 00-23
  time-minute     = 2DIGIT  ; 00-59
  time-second     = 2DIGIT  ; 00-58, 00-59, 00-60 based on leap second
                             ; rules
  time-secfrac    = "." 1*DIGIT
  time-numoffset  = ("+" / "-") time-hour ":" time-minute
  time-offset     = "Z" / time-numoffset
Community
  • 1
  • 1
Bertrand Martel
  • 42,756
  • 16
  • 135
  • 159
  • 1
    The example `20150716203621.000Z` shown in the Question is the "basic" version of this format. The expanded version is easier to read: `2015-07-T16:20:36.21.000Z` with a `T` separating the date portion from time-of-day portion. You may trade the `T` for a SPACE for further readability but not recommended for data exchange. – Basil Bourque Aug 15 '15 at 02:48