Iso8601Utils

Jackson’s date formatter, pruned to Moshi's needs. Forked from this file: https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java

Utilities methods for manipulating dates in iso8601 format. This is much much faster and GC friendly than using SimpleDateFormat so highly suitable if you (un)serialize lots of date objects.

Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]]

See also

<a href="http://www.w3.org/TR/NOTE-datetime">this specification</a>

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun format(date: Date): String
Returns date formatted as yyyy-MM-ddThh:mm:ss.
Link copied to clipboard
open fun parse(date: String): Date
Parse a date from ISO-8601 formatted string.