Add seconds to Date

fabioferreiracs

Member
Licensed User
Longtime User
I need to add 10800 seconds to a specifies date "22/01/2013 14:00:00".
how i do?

I tried several options unsolved. I have the seconds to add and date according to the model.

Thanks
 

MLDev

Active Member
Licensed User
Longtime User
Here's one way to do it using DateTime methods:

B4X:
DateTime.DateFormat = "dd/MM/yyyy"
Dim t As Long = DateTime.DateTimeParse("22/01/2013", "14:00:00")
t = t + 10800 * DateTime.TicksPerSecond
Log(DateTime.Date(t) & " " & DateTime.Time(t))
 
Upvote 0
Top