mysql curious behavour of datetime field
Posted
#1
(In Topic #295)
Regular

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
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
Gambas 3.13.0
Posted
Regular

Posted
Regular

That's exactly what it is. It was recently discussed on the mailing list.
[Gambas-user] A little bit of Date Testing
[Gambas-user] Using dates in Gambas
Hopefully, that'll help you out a bit.
Ced
.... and carry a big stick!
Posted
Regular

Posted
Administrator

1 guest and 0 members have just viewed this.


