[Gambas-user] Gambas Dates
Gianluigi
bagonergi at gmail.com
Sun Nov 24 19:31:11 CET 2019
If you need only the date use ValueBox with property Type on Date.
If you need date and time use it on DateTime.
Remember dates are dates not strings
See attached project
Regards
Gianluigi
Il giorno dom 24 nov 2019 alle ore 17:12 David Silverwood via User <
user at lists.gambas-basic.org> ha scritto:
> actually, this brings me to another issue... what happened to the datebox
> in 3.14? I have a timebox but no datebox? I assume therefore I should be
> able to put it back into the toolbox somehow?
>
> On Sunday, November 24, 2019, 05:23:08 PM GMT+2, T Lee Davidson <
> t.lee.davidson at gmail.com> wrote:
>
>
> 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 ]----
> >
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
> ]----
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20191124/68533bdc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DataDate-0.0.1.tar.gz
Type: application/gzip
Size: 13064 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20191124/68533bdc/attachment-0001.gz>
More information about the User
mailing list