### Add hours, minutes or seconds

Example calculation adding Hours or Minutes or Seconds to a given Timme.
'Add hours to a given time
'Example Output from AddHours(DateTime.Now, 2) is 16:19 - 18:19
`Sub AddHours(TimeStart As Long, Hours As Int) As String
DateTime.TimeFormat = "HH:mm"
Log($"${DateTime.Time(TimeStart)} - ${DateTime.Time(TimeStart + (Hours * 60 * 60 * 1000))}"$)
Return $"${DateTime.Time(TimeStart + (Hours * 60 * 60 * 1000))}"$
End Sub`
'Add minutes to a given time
'Example Output from AddMinutes(DateTime.Now, 30) is 16:16 - 16:46
`Sub AddMinutes(TimeStart As Long, Minutes As Int) As String
DateTime.TimeFormat = "HH:mm"
Log($"${DateTime.Time(TimeStart)} - ${DateTime.Time(TimeStart + (Minutes * 60 * 1000))}"$)
Return $"${DateTime.Time(TimeStart + (Minutes * 60 * 1000))}"$
End Sub`
'Add seconds to a given time
'Example Output from AddSeconds(DateTime.Now, 10) is 16:21:25 - 16:21:35
`Sub AddSeconds(TimeStart As Long, Seconds As Int) As String
DateTime.TimeFormat = "HH:mm:ss"
Log($"${DateTime.Time(TimeStart)} - ${DateTime.Time(TimeStart + (Seconds * 1000))}"$)
Return $"${DateTime.Time(TimeStart + (Seconds * 1000))}"$
End Sub`

Changed: , Category: DateTime, File: T6C183M1317.htm, ID: 1317