ISO 8601 Date Time Format

ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date- and time-related data. It was issued by the International Organization for Standardization (ISO) and was first published in 1988. The purpose of this standard is to provide an unambiguous and well-defined method of representing dates and times, so as to avoid misinterpretation of numeric representations of dates and times, particularly when data are transferred between countries with different conventions for writing numeric dates and times. For more detail, see Wikipedia.

Date and time expressed according to ISO 8601:

Item Value
Date 2018-07-22
Combined date and time in UTC 2018-07-22T05:41:15+00:00
2018-07-22T05:41:15Z
20180722T054115Z
Week 2018-W29
Date with week number 2018-W29-7
Date without year –07-22 (last in ISO8601:2000, in use by RFC 6350)
Ordinal date 2018-203

Related blog posts:

Convert Date to ISO 8601 String in Java

Convert Java dates to ISO-8601 string: this post explains how to convert java.util.Date, java.util.Calendar, java.time.ZonedDateTime to string.