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.
Asked
Active
Viewed 890 times
0
-
2yyyyMMddHHmmss.zzz(Z) – gunr2171 Aug 14 '15 at 20:18
-
Similar Question: [Java Date format of '2010-10-11T22:10:10.000Z'](http://stackoverflow.com/q/4900028/642706). – Basil Bourque Aug 15 '15 at 02:50
3 Answers
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.
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
-
1The 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