这是indexloc提供的服务,不要输入任何密码

Bug: 357896336

Clone this repo:
  1. 254ff50 Add janitors to the OWNERS file am: e608ace3a5 by Sadaf Ebrahimi · 7 months ago main
  2. e608ace Add janitors to the OWNERS file by Sadaf Ebrahimi · 7 months ago aml_per_351112300
  3. a5d0617 Remerge AOSP main history into aosp-main-future. by Xin Li · 8 months ago aml_con_351110000
  4. 336d604 Merge remote-tracking branch 'origin/upstream' am: f4f2e69a1d by Inna Palant · 10 months ago aml_per_351410020 aml_wif_351410040
  5. f4f2e69 Merge remote-tracking branch 'origin/upstream' by Inna Palant · 11 months ago

Overview

jISO8601 is yet another library made to parse dates in Java. It may still be useful since:

  • It's trivial to use
  • It's lightweight
  • It's compatible with Android
  • It can parse any date compatible with the norm

Getting started

There are only two public methods:

import fr.turri.jiso8601.*;
...
Calendar cal = Iso8601Deserializer.toCalendar("1985-03-04");
Date date = Iso8601Deserializer.toDate("1985-03-04T12:34:56Z");

Each type of ISO8601 dates are supported (calendar, ordinal and week dates, basic and extended format) as weel as each format of hour and timezone.

Installation

Using it with maven

This package will soon be available on maven central. For now it needs to be build from source. For instance, on Ubuntu:

git clone https://github.com/gturri/jiso8601
cd jiso8601
sudo apt-get install maven
mvn install

Then, in your pom.xml, add

<dependency>
    <groupId>fr.turri</groupId>
    <artifactId>jISO8601</artifactId>
    <version>0.1</version>
</dependency>

Out of scope (for now)

Recurring time interval and Periods aren't supported. Feel free to open feature requests.