madison54
madison54

Reputation: 763

How to best handle LocalDateTimes and UTC times in Android?

I want to use LocalDateTimes as well as UTC times in an Android application (targetSDK=23, minSDK=19, JDK=Java 8).

In a native Java 8 application I would use the newly introduced java.time API. However, it appears that Android does not support this API.

At the time of this post and under the above SDK/JDK restrictions, what would you suggest is best practice/library/framework to handle LocalDateTime and UTC times in the same code base?

Upvotes: 1

Views: 45

Answers (1)

OBX
OBX

Reputation: 6114

Did you try the Google Maps Time Zone API , it provides time offset data for locations on the surface of the earth. Requesting the time zone information for a specific Latitude/Longitude pair will return the name of that time zone, the time offset from UTC, and the Daylight Savings offset. Try this.

Upvotes: 1

Related Questions