Closed mel4tonin4 closed 3 years ago
The conversion you want depends on java.time.Instant
. This type is not available in old Android installations before level 26. Time4A is intentionally designed such that it even supports very old levels from 9 onwards. For more discussion see my answer to your previous question.
If you want to develop an Android app with the constraint to use only level 26+ then you can actually only do one of two ways:
a) You ignore java.time.Instant
and simply use the class net.time4j.Moment
directly (even including leap seconds).
b) Or you convert a Moment
to java.util.Date
and then to Instant
accepting some loss of precision (millisecond versus nanoseconds)
See my comment to my other question, which takes into consideration both your answers. Thanks for your...time, Meno. Have a nice day!
Hello.
Why is TemporalType.INSTANT not available on Android?
What should I use instead?
Thanks.