15 questions
0
votes
0
answers
72
views
Troubleshooting JitPack Build Errors with ThreeTenABP Fork
Our legacy app relies heavily on JakeWharton’s ThreeTenABP:
https://github.com/JakeWharton/ThreeTenABP
We know this library is no longer maintained and should eventually be migrated away from. However,...
5
votes
2
answers
610
views
How do I calculate age from my date picker?
I am learning Kotlin on my own. I am trying to calculate the age of a user after the have input their date of Birth and display it in another activity.
I tried a bunch of different stuff and none ...
2
votes
1
answer
741
views
android: Desugaring of ZonedDateTime results in TimeOffset being null
I'm trying to migrate from ThreeTen Android Backport to java.time with desugaring. On debug builds this works perfectly, but on release builds (minifyEnabled = true) I get a weird error on runtime.
...
2
votes
1
answer
683
views
ThreeTenABP DateTime parser giving exception for yyyy-MM-ddTHH:mm:ss formate
I need to convert a dateTime String to millis and I am using ThreeTenABP for this, but the OffSetDateTime.parse is unable to parse the dateTime String which is for ex. "2020-08-14T20:05:00" ...
0
votes
1
answer
377
views
org.threeten.bp.format.DateTimeParseException: Text 'Sat Sep 19 2020 07:14 AM PDT' could not be parsed at index 25 at $.root.bsa[0].posted
I'm trying to parse a date that looks like:
Sat Sep 19 2020 07:14 AM PDT
into a ZonedDateTime.
I'm using this formatter
DateTimeFormatter.ofPattern(
"EEE MMM dd yyyy hh:mm a zzz",
Locale....
0
votes
1
answer
763
views
parsing DateTime with ThreetenBp causes DateTimeParseException or incomplete string error
I am trying to check if the date has passed more than one day or not.
And I got these errosr while it parses the string.
java.lang.IllegalArgumentException: Pattern ends with an incomplete string ...
0
votes
2
answers
1k
views
java.time format date depending on locale with 2 digits day/month and 4 digits year
I need to show a date with 2 digits day, 2 digits month, 4 digits year according to the order of the local. So for April 10th 2020 I want to show
for locale US: MM/DD/YYYY -> 04/10/2020
for locale UK: ...
3
votes
0
answers
356
views
Gradle sync error: Duplicate key AdditionalClassifierArtifactsImpl
I'm building an Android project. When I open my the project, during the gradle sync, I keep getting the following error message:
Duplicate key AdditionalClassifierArtifactsImpl(
id= ...
1
vote
2
answers
128
views
DateTimeParseException at index 0 with ThreeTenABP
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....
0
votes
2
answers
1k
views
org.threeten.bp.format.DateTimeParseException
val dateFormatter= DateTimeFormatterBuilder()
.appendPattern("yyyy-MM-dd")
.toFormatter()
val begin = (LocalDateTime.parse("2019-11-04", dateFormatter).atOffset(ZoneOffset.UTC)
...
3
votes
1
answer
889
views
How to setup and use ThreeTenABP library
I can't get ThreeTenABP to work. Here's what I did:
import dependency in app build.gradle
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
initialize the library in MyApplication....
3
votes
1
answer
3k
views
How to make LocalDate and LocalTime parcelable?
I am new to android, and making a doctor's appointment managing android app using ThreeTenABP's (so it's compatible with more devices) LocalDate and LocalTime, which I need to make parcelable.
I ...
1
vote
1
answer
1k
views
Why is my UTC instant not converting to BST?
I have the following code:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.UK);
Instant inst = DateTimeUtils.toInstant(sdf.parse("2019-08-13T18:00:00Z"));
...
30
votes
2
answers
77k
views
How to convert ZonedDateTime/OffsetDateTime to Date using ThreeTenABP?
Using the ThreeTen Android Backport library, what is the simplest way to convert a ZonedDateTime or OffsetDateTime into an old-school java.util.Date instance?
If I had full Java 8 libs at my disposal,...
235
votes
3
answers
44k
views
How to use ThreeTenABP in Android Project
I'm using Android Studio 2.1.2 and 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....