threetenabp

DateTimeParseException at index 0 with ThreeTenABP

大兔子大兔子 提交于 2020-05-16 03:25:11
问题 I'm trying to parse a time string with ThreeTenABP (because I have to support min SDK 19). I think the string is ISO 8601: 20200117T172638.000Z I get the following exception: org.threeten.bp.format.DateTimeParseException: Text '20200117T172638.000Z' could not be parsed at index 0 My code: Instant instant = Instant.parse("20200117T172638.000Z"); long time = instant.getEpochSecond(); Any help appreciated. Thanks in advance. 回答1: This is a little bit tricky alright. DateTimeFormatter

How to use ThreeTenABP in Android Project

心不动则不痛 提交于 2019-11-25 22:09:28
问题 I am asking this question because I am new to Java and Android and I searched for hours trying to figure this out. The answer came from a combination of related answers, so I figured I would document what I learned for anyone else who may be struggling. See answer. I am using Android Studio 2.1.2. My Java setup is the following: >java -version > openjdk version \"1.8.0_91\" > OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~15.10.1-b14) > OpenJDK 64-Bit Server VM (build 25.91-b14