I need to calculate the minutes, hours, days elapsed from a datetime stored on server located in UK and phone date time, the server date time format is: yyyy-mm-dd hh:mm:ss
Since the app is distributed worldwide, the elapsed time should not be affected by local phone timezone for this reason i have set: Datetime.SetTimeZone(1) but im not sure if this code is correct or is gonna fail somehow.
l.
Since the app is distributed worldwide, the elapsed time should not be affected by local phone timezone for this reason i have set: Datetime.SetTimeZone(1) but im not sure if this code is correct or is gonna fail somehow.
B4X:
DateTime.SetTimeZone(1)
Dim DateString = M.Get("sent_date") As String
Dim DateTimeTicks As Long
Dim Date_Time() As String
Date_Time = Regex.Split(" ", DateString)
DateTime.DateFormat = "yyyy-MM-dd"
DateTime.TimeFormat = "HH:mm:ss"
DateTimeTicks = DateTime.DateTimeParse(Date_Time(0), Date_Time(1))
Dim ticks As Long = DateTime.Now - DateTimeTicks
Dim minutes As Int = ticks / DateTime.TicksPerMinute
l.