R ratfink New Member Licensed User Longtime User Feb 27, 2012 #1 Firstly, what a GREAT piece of software, I am VERY impressed! I would like the DateTime.Add to be able to do minutes and seconds just like the DateAdd(interval, number, date) in VB6 This would also allow for 1/2 time zones i.e. South Australia. Regards Ratfink (Geoff)
Firstly, what a GREAT piece of software, I am VERY impressed! I would like the DateTime.Add to be able to do minutes and seconds just like the DateAdd(interval, number, date) in VB6 This would also allow for 1/2 time zones i.e. South Australia. Regards Ratfink (Geoff)
Erel B4X founder Staff member Licensed User Longtime User Feb 28, 2012 #2 Here: Code: Copy Sub TimeAdd(Ticks As Long, Hours As Int, Minutes As Int, Seconds As Int) As Long Return Ticks + Hours * DateTime.TicksPerHour + Minutes * DateTime.TicksPerMinute + Seconds * DateTime.TicksPerSecond End Sub Note that time zones are handled automatically.
Here: Code: Copy Sub TimeAdd(Ticks As Long, Hours As Int, Minutes As Int, Seconds As Int) As Long Return Ticks + Hours * DateTime.TicksPerHour + Minutes * DateTime.TicksPerMinute + Seconds * DateTime.TicksPerSecond End Sub Note that time zones are handled automatically.