mysql curious behavour of datetime field
Posted: Friday 26th July 2019 9:55am
I have a datetime field in a mysql database. I recently added a record with the value 07/25/2019 23:00:00 (I think)
When displayed in a gridview table 07/25/2019 23:00:00 is shown but "print hResult!DateTime" shows "26/07/2019 00:00:00"
I have made a simple programme that creates a new record " hResultNew!TestDateTime = Date(2019, 7, 29, 23, 30, 00)" but the display in gridview has the wrong time.
What's going on here!
I hope I'm not doing something stupid but any ideas are welcome
Gambas 3.13.0
When displayed in a gridview table 07/25/2019 23:00:00 is shown but "print hResult!DateTime" shows "26/07/2019 00:00:00"
I have made a simple programme that creates a new record " hResultNew!TestDateTime = Date(2019, 7, 29, 23, 30, 00)" but the display in gridview has the wrong time.
What's going on here!
I hope I'm not doing something stupid but any ideas are welcome
Code: Select all
Private hConn As New Connection
Private hResult As Result
Public Sub Form_Open()
Dim i As Integer
' hConn = MysqlLibrary.DbConnect("test")
With hconn
.Type = "mysql"
.Port = "3306"
.Host = "localhost"
.User = "root"
.Password = "*******"
.Name = "test"
.Open()
End With
hResult = hConn.Find("general")
gdvTest.Columns.Count = 2
gdvTest.Rows.Count = hResult.Count
For Each hResult
gdvTest[i, 0].Text = hResult!id
gdvTest[i, 1].Text = hResult!TestDateTime
Print hResult!TestDateTime
Inc i
Next
End
Public Sub Button1_Click()
Dim hResultNew As Result
hResultNew = hConn.Create("general")
hResultNew!TestDateTime = Date(2019, 7, 29, 23, 30, 00)
hResultNew.Update
End