Righto. This code:
DateTime.DateFormat = "yyyy-MM-dd"
DateTime.TimeFormat = "HH:MM:ss Z"
Dim T As Long = DateTime.Now
Log(T)
Log(DateTime.Date(T))
Log(DateTime.Time(T))
Dim T As Long = 0
Log(T)
Log(DateTime.Date(T))
Log(DateTime.Time(T))
gives this:
1565080535551
2019-08-06
18:08:35 +1000
0
1970-01-01
10:01:00 +1000
which suggests that the ticks time is UTC time, and that DateTime displays that time but adjusted for the device's timezone.
I have two minor quirks going on, though:
Firstly, date/time 0 is out by 1 minute (10:01:00 rather than 10:00:00) but I suspect that might be due to leap seconds. Leap seconds are now 37 since 1970, so rounded off to nearest minute, that'd match the 10:01 time offset.
Secondly, the B4A shows 18:38 not 18:08 ie off by half an hour. The phone itself shows the correct time, ie half an hour ahead. Changed to another phone, works fine. Odd. I assume that if I put a SIM in, then it will right itself.