F fabioferreiracs Member Licensed User Longtime User Jan 22, 2013 #1 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
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
M MLDev Active Member Licensed User Longtime User Jan 22, 2013 #2 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
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))
F fabioferreiracs Member Licensed User Longtime User Jan 22, 2013 #3 ok, that is all I needed. thank. Erel , congratulations ; DateTime.DateTimeParse is the best ! Upvote 0