I would like to add 3 minutes to lbltime.Text. How can i do that? I know i can add the minutes to timenow, but I want to add them to lbltime (later after i have already set lbltime)
Dim timenow As Long
DateTime.TimeFormat="HH:mm"
timenow=DateTime.Now
Log("TimeNow: "&DateTime.Time(timenow))
Dim per As Period
per.Initialize
per.Minutes = 3
Log("New Time: "&DateTime.Time(DateUtils.AddPeriod(timenow,per)))
lbltime.Text=txtSettime.Text
Dim servtime As String
Dim per As Period
per.Initialize
per.Minutes = 2
'Log("New Time: "&DateTime.Time(DateUtils.AddPeriod(lbltime.Text,per)))
servtime=DateTime.Time(DateUtils.AddPeriod(lbltime.Text,per))
lbltimetowritetoserver.Text=servtime
AddPeriod expects a first parameter a datetime (a long)... You also DID NOT recognized my hint about parse...
you first need to convert the string to a datetime value... USE the forumsearch
DateTime.TimeFormat="HH:mm"
Dim timenow As Long
timenow = DateTime.TimeParse(EditText1.Text)
Log("TimeNow: "&DateTime.Time(timenow))
Dim per As Period
per.Initialize
per.Minutes = 3
Log("New Time: "&DateTime.Time(DateUtils.AddPeriod(timenow,per)))
Date and Time values are presented in Ticks, therefore the need to parse them from human values to machine readable ones DateTime.TimeFormat="HH:mm"
Dim timenow As Long
timenow = DateTime.TimeParse(EditText1.Text)
Log("TimeNow: "&DateTime.Time(timenow))
Dim per As Period
per.Initialize
per.Minutes = 3
Log("New Time: "&DateTime.Time(DateUtils.AddPeriod(timenow,per))
lbltime.Text=txtSettime.Text
Dim servtime As Long
Dim diskwtime As Long
Dim per As Period
'servtime=DateTime.TimeParse(lbltime.Text)
diskwtime=DateTime.TimeParse(lbltime.Text)
per.Initialize
per.Minutes = 2
diskwtime=lbltime.Text
servtime=DateTime.Time(DateUtils.AddPeriod(diskwtime,per))
lbltimetowritetoserver.Text=servtime
lbltime.Text=txtSettime.Text
Dim servtime As Long
Dim diskwtime As Long
Dim per As Period
'servtime=DateTime.TimeParse(lbltime.Text)
diskwtime=DateTime.TimeParse(lbltime.Text)
per.Initialize
per.Minutes = 2
diskwtime=lbltime.Text
servtime=DateTime.Time(DateUtils.AddPeriod(diskwtime,per))
lbltimetowritetoserver.Text=servtime
Dim servtime As Long
Dim diskwtime As Long
Dim per As Period
'servtime=DateTime.TimeParse(lbltime.Text)
diskwtime=DateTime.TimeParse(lbltime.Text) ' <--- Here you are doing it right
per.Initialize
per.Minutes = 2
diskwtime=lbltime.Text ' <-- here you are doing the same error as before...BTW: This line is not needed
servtime=DateTime.Time(DateUtils.AddPeriod(diskwtime,per))
lbltimetowritetoserver.Text=servtime