Android Question How to convert GMT time to my local Time?

Alhootti

Active Member
Hi Guys
I'm getting the time in GMT could anyone help me to convert it to my local time
TimeZone(4)
B4X:
If ReadData.StartsWith("$GNGLL") Then
        Dim parts() As String = Regex.Split(",", ReadData)
        Dim Time As String = parts(5)
        Dim hours As String = Time.SubString2(0, 2)
        Dim minutes As String = Time.SubString2(2, 4)
        Dim seconds As String = Time.SubString2(4, 6)
        Label2.Text = hours & ":" & minutes & ":" & seconds
        End If
 

drgottjr

Expert
Licensed User
Longtime User
Note that you're probably getting "time in GPS" not "time in GMT". GPS time is 18 seconds ahead of GMT aka UTC.

http://leapsecond.com/java/gpsclock.htm
i always use gps time; in the event of nuclear attack, my plan is to use the extra 18 seconds to grab my b4x backups NAS and get into the basement.

for interested parties, the next leap second adjustment is pencilled in for june 30, 2025.
too early to know if it will be plus 1 or minus 1. i hear a lot of money is being wagered on the result.
 
Upvote 0
Top