Hi,
I am using the following code to generate a time & date string..
The question I have is how can I add 30 seconds to the following code ?
So if it logs 17:44:34 29-05-2016 how can I make it so it adds 30 seconds to it so it becomes: 17:45:04 29-05-2016
I know this sounds easy but can't work it out.
I am using the following code to generate a time & date string..
B4X:
Dim current_time As String = DateTime.GetHour(DateTime.Now) & ":" & DateTime.GetMinute(DateTime.Now) & ":" & DateTime.GetSecond(DateTime.Now)
Dim current_date As String = DateTime.GetDayOfMonth(DateTime.Now) & "-" & DateTime.GetMonth(DateTime.Now) & "-" & DateTime.GetYear(DateTime.Now)
Dim current_year As String = DateTime.GetYear(DateTime.Now)
Dim current_month As String = NumberFormat(DateTime.GetMonth(DateTime.Now),2,0)
Dim current_dayofmonth As String = NumberFormat(DateTime.GetDayOfMonth(DateTime.Now),2,0)
Dim current_hh As String = NumberFormat(DateTime.GetHour(DateTime.Now),2,0)
Dim current_min As String = NumberFormat(DateTime.GetMinute(DateTime.Now),2,0)
Dim current_sec As String = NumberFormat(DateTime.GetSecond(DateTime.Now),2,0)
current_time = current_hh & ":" & current_min & ":" & current_sec
current_date = current_dayofmonth & "-" & current_month & "-" & current_year
Log(current_time & " " & current_date)
The question I have is how can I add 30 seconds to the following code ?
So if it logs 17:44:34 29-05-2016 how can I make it so it adds 30 seconds to it so it becomes: 17:45:04 29-05-2016
I know this sounds easy but can't work it out.