Sub Button1_Click
Log(GetStrTo("11/7/2021 12:00:00",1))
End Sub
Private Sub GetStrTo(strFrom As String, AddHour As Int) As String
Try
Dim Arr() As String
'Dim NotTimeDate As String,NoteTimeStr As String
Dim DateStr As String, TimeStr As String
Dim P As Period
Dim Tick As Long ,NewTick As Long
Dim strTo As String
P.Hours=AddHour
Arr=Regex.Split(" ", strFrom)
DateStr=Arr(0)
TimeStr=Arr(1)
'strFrom=NoteTimeStr
'Log($"Date ${DateStr}"$)
'Log($"Time ${TimeStr}"$)
'Log($"Timeformat ${DateTime.TimeFormat}"$)
Tick=DateTime.DateTimeParse(DateStr,TimeStr)
NewTick=DateUtils.AddPeriod(Tick,P)
strTo=DateUtils.TicksToString(NewTick)
Return strTo
Catch
Log("GetStrTo " & LastException.Message)
'
Return "Error"
End Try
End Sub