Android Question Conversion of Date and Time across Timezones and database storage


The project I am designing (finance related) has these requirements:
1. Client organisation has location in 3 different timezones (none is utc/gmt)
2. Users in each location will work in their local times but the app must save all transactions with the local values converted to head-office datetime values.
3. Retrieved values will again be presented on-screen in the original local values.

I have tried to look at the methods of DateTime api and DateUtils library especially SetTimeZoneOffset() and SetDateAndTime2() but I don't know if they will suffice or there are some gotchas.ut I'm not sure how I can plan such a scenario. There could be problems with daylightsavings too.

I will appreciate any guidance and possibly code snippets.


B4X founder
Staff member
Licensed User
Longtime User
The best way is to use a date format that includes the date, time and the timezone.

Upvote 0