[Gambas-user] Gambas Dates

T Lee Davidson t.lee.davidson at gmail.com
Sun Nov 24 16:22:33 CET 2019


The date is stored in the db as text?
And, edtDate is a TextBox?


___
Lee


On 11/24/19 4:33 AM, David Silverwood via User wrote:
> me again-
> I have the strangest thing happening when I load a record in my SQLite database. Gambas reads the dates then subtracts a day. So 
> instead of say 2019-11-22 which is the actual date in the db, Gambas loads 2019-11-21. I cannot think that this is supposed to 
> happen.
> My code:
> 
> Public Sub Button5_Click()          ' load the record into a form
>      '
> 
>      Inc Application.Busy
> 
>      $Request = "SUPPLIER = &1 AND INVOICE_NO = &2"
> 
>      $Result = conMod.$Con.Edit("Documents", $Request, Trim(cboSupplier.Text), Trim(edtInvoice.Text))
>      edtRef.Text = $Result!REF
>      edtDate.Text = $Result!DATE         ' ... and my date appears one day earlier than it is written in the database... wtf
>      cboSupplier.Text = $Result!SUPPLIER
>      edtInvoice.Text = $Result!INVOICE_NO
>      edtDelivery.Text = $Result!DELIVERY_NOTE
>      edtOrder.Text = $Result!ORDER_NO
>      cboReceipt.Text = $Result!RECEIVED
>      edtAdmin.Text = $Result!ADMIN
>      $Result.Update
> 
>      $Date = Left(edtDate.Text, 10)
>      edtDate.Text = Format($Date, "yyyy-mm-dd")
> 
>      $Date = Left(edtAdmin.Text, 10)
>      edtAdmin.Text = Format($Date, "yyyy-mm-dd")
> 
>      Button1.Enabled = True
>      Button3.Enabled = True
>      Button4.Enabled = True
>      Button2.Enabled = True
> 
> Finally
>      Dec Application.Busy
> 
> Catch
>      objErr.dhError()
> 
> End
> 
> Any assistance will be appreciated.
> 
> Thx and regards
> 
> David
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 


More information about the User mailing list