If I use the time zone function <DefTimeZone=DateTime.TimeZoneOffset>
in my app, I get the value 2 in the Netherlands.
For example, if someone uses my app in the USA, will the timezone function show the correct timezone in the USA? If so, then I can simply use the difference in hours in both time zones to adjust my dates and times.
Is this correct, or am I missing another function or lib.
Probably neither is correct. You should be doing all of your time and date computation, and saving values in databases, using Android "system" time values (ie UTC). You only need to worry about local time zones when you want to display a DateTime value to the User, and then you do not actually need to worry at all because the DateTime functions will take care of it for you.
B4X:
Log(DateTime.Time(DateTime.Now))
This will display the time according to the local time zone, including any daylight saving time adjustments, anywhere in the world. If the date is an historical date (eg from a time when a different daylight saving adjustment was active) then the appropriate local time will still be displayed.
Only use B4J now !
The FIFA worldcup football schedule was made in Dutch time (GMT+2).
When you run the app in USA or in Asia the app will adjust all date and time of the schedule to local time.
Look in MainPage at:
Public Sub AdjustTimeZone(NewTimeZone As Float)
Public Sub CheckLeapYear(A1 As Float)
Sub AdjustTimeZoneFunction(inDate As Long, inTime As Float)
I dont know if its correct. Local timezone is measured by DefTimeZone=DateTime.TimeZoneOffset
Public LastTimeZone, DefTimeZone, FileTimeZone As Double
Set up the match timetable in UTC time (Netherlands time minus two hours) and the match times will be shown in local time wherever the app is used - no need for any time zone calculations. Why make it hard for yourself? (B4J or B4A makes no difference, I think).