utils / com.revenuecat.purchases.utils / Iso8601Utils

Iso8601Utils

class 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

<init>

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

Iso8601Utils()

Functions

format

Returns date formatted as yyyy-MM-ddThh:mm:ss.sssZ

static fun format(date: Date!): String!

parse

Parse a date from ISO-8601 formatted string. It expects a format [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh:mm]]

static fun parse(date: String!): Date!