Android Question Time format problems

LorenzoTRANSFEREX

Member
Licensed User
Hi,
I am trying to send the current date and time to a SQL database with datetime format field.
I am trying save the date with 'dd/MM/yy HH:mm' format but ever gets SQL error 'parsing a string to date or time'
There is not problem saving the date independently, but I am not able to save the time join to date or in another field with datetime format.

In this code:
B4X:
  DateTime.DateFormat = "dd/MM/yy HH:mm"
  getSQLcommand("update_maps",Array As Object(DateTime.Time(DateTime.Now) & " " & DateTime.Time(DateTime.Now),LastLocation.Latitude,LastLocation.Longitude,adapter.RunMethod("getName", Null)))
   Log("The time now is: " & DateTime.Time(DateTime.Now))

the log show only the minutes, not the hour, and the log shows:
The time now is: 19
com.microsoft.sqlserver.jdbc.SQLServerException: Error al convertir una cadena de caracteres en fecha y/u hora.


Thanks for your help.
 
Top