Question how to convert a time value into minutes

after a bit of working myself i came up with the following code:
VB.NET:
dim lastlogin1 = GetSetting("TimeLimiter", username, "lastlogin", DateTime.Today)
                        Dim z = GetSetting("TimeLimiter", username, "lastlogouttime")
                        z = CDate(z)

                        lastlogouttime = z

                        Dim ts As New TimeSpan(0, lastlogouttime.Hour, lastlogouttime.Minute, lastlogouttime.Second)
                        Dim res As Integer = ts.TotalMinutes

z = "01:13:14"

and res returned 73 minutes :D

sorry to waste any time lol
 
z = "01:13:14"
From string you can use the Parse method:
Dim minutes = CInt(TimeSpan.Parse(z).TotalMinutes)
 
Back
Top