D Declan Well-Known Member Licensed User Longtime User Jan 4, 2026 #1 I have the following code that writes the Date to a mySQL DB: B4X: Dim myID As String = deviceID Dim myDate As String DateTime.DateFormat = "dd/mm/yyyy" myDate = DateTime.Date(DateTime.Now) SQL.ExecNonQuery2("INSERT INTO regdevices (deviceid, regdate) VALUES (?, ?)", Array(myID, myDate)) However, the date that is returned is: B4X: 04/30/2026 Month is dodgy Should be: 04/01/2026
I have the following code that writes the Date to a mySQL DB: B4X: Dim myID As String = deviceID Dim myDate As String DateTime.DateFormat = "dd/mm/yyyy" myDate = DateTime.Date(DateTime.Now) SQL.ExecNonQuery2("INSERT INTO regdevices (deviceid, regdate) VALUES (?, ?)", Array(myID, myDate)) However, the date that is returned is: B4X: 04/30/2026 Month is dodgy Should be: 04/01/2026
D Declan Well-Known Member Licensed User Longtime User Jan 4, 2026 #2 Got it. Changed DateTime.DateFormat = "dd/mm/yyyy" To DateTime.DateFormat = "dd/MM/yyyy" Upvote 0