After read some threads in the forum about datetime related questions, I'm yet unable to understand why the next sentence:
Log(DateTime.Time(DateTime.TicksPerMinute * 30))
gives "1:30:00" instead of "00:30:00"
Dim p As Period =DateUtils.PeriodBetween(0, DateTime.TicksPerMinute * 30) 'need dateutils library
Log($"$2.0{p.Hours}:$2.0{p.Minutes}:$2.0{p.Seconds}"$)
DateTime.Time(DateTime.TicksPerMinute * 30) is an instance of time at a given old date many decades ago.
Dim p As Period =DateUtils.PeriodBetween(0, DateTime.TicksPerMinute * 30) 'need dateutils library
Log($"$2.0{p.Hours}:$2.0{p.Minutes}:$2.0{p.Seconds}"$)
DateTime.Time(DateTime.TicksPerMinute * 30) is an instance of time at a given old date many decades ago.
This code converts milliseconds to hours, minutes and seconds: Sub ConvertMillisecondsToString(t As Long) As String Dim hours, minutes, seconds As Int hours = t / DateTime.TicksPerHour minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute seconds = (t Mod...
The "smart string" literal is a more powerful version of the standard string literal. It has three advantages: Supports multi-line strings. No need to escape quotes. Supports string interpolation. The smart string literal starts with $" and ends with "$. Examples: Dim s As String = $"Hello...
1. Please use [code]code here...[/code] tags when posting code.
2. This code is completely wrong: Log(DateTime.Time(DateTime.TicksPerMinute * 30))
It is explained in the date and time video tutorial: https://www.b4x.com/etp.html
Well worth watching if you are working with dates and times.
If you want to convert milliseconds to string then follow the link @Mahares posted above.