<html><head></head><body><div class="ydp2c6841feyahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
        <div>Hi Benoit</div><div><br></div><div>It will be great if you can explain the database date handling because I can for the life of me not get Gambas to keep a sqlite date in sqlite format. (when loading from the database). Tried Str$, Format$, etc and no luck to date. It defaults to US format no matter what I try. I thought it had to do with my regional settings but Gambas apparently reads that perfectly when using </div><div><br><div><div>Print System.TimeZone</div><div>Print System.Language</div></div><div><br></div> last try Gambas complained as follows: </div><div><br><div>
<p style="margin: 0px;"><!--StartFragment-->The following error has occurred:</p>
<div style="margin: 0px;">Type mismatch: wanted Date, got String instead </div><div style="margin: 0px;">(PS. I wanted a "date" as a string and not a date, in the hope that gambas would leave it alone...)</div></div></div><div style="margin: 0px;"><br></div><div style="margin: 0px;">I'm about ready to give up here...</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Many thanks</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">David</div><div style="margin: 0px;"><br></div><div><br></div>
        
        </div><div id="ydpff950f7byahoo_quoted_9376086476" class="ydpff950f7byahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Saturday, May 18, 2019, 1:54:08 PM GMT+2, Gianluigi <bagonergi@gmail.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="ydpff950f7byiv7657369545"><div><div dir="ltr"><div dir="ltr"><br clear="none"></div><br clear="none"><div class="ydpff950f7byiv7657369545gmail_quote"><div class="ydpff950f7byiv7657369545gmail_attr" dir="ltr">Il giorno ven 17 mag 2019 alle ore 21:44 Benoît Minisini <<a shape="rect" href="mailto:g4mba5@gmail.com" rel="nofollow" target="_blank">g4mba5@gmail.com</a>> ha scritto:<br clear="none"></div><blockquote class="ydpff950f7byiv7657369545gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">Hi,<br clear="none">
<br clear="none">
As I notice that almost nobody suceeds in dealing with date & time <br clear="none">
correctly, I started to wrote a overview about that in the wiki.<br clear="none">
<br clear="none">
<a shape="rect" href="http://gambaswiki.org/wiki/doc/date" rel="nofollow" target="_blank">http://gambaswiki.org/wiki/doc/date</a><br clear="none">
<br clear="none">
Please feal free to comment and modify this page so that date & time <br clear="none">
management becomes as clear as possible.<br clear="none">
<br clear="none">
This is still a work in progress, and I especially need "how to" code <br clear="none">
example about dates.<br clear="none">
<br clear="none">
Regards,<br clear="none">
<br clear="none">
-- <br clear="none">
Benoît Minisini<br clear="none"></blockquote><div><br clear="none"></div><div><br clear="none"></div><div>Hi Benoit,<br clear="none">probably could have inspired what I wrote here:<br clear="none"><br clear="none"><a shape="rect" href="https://lists.gambas-basic.org/pipermail/user/2019-May/067200.html" rel="nofollow" target="_blank">https://lists.gambas-basic.org/pipermail/user/2019-May/067200.html</a><br clear="none"><br clear="none">In fact when I write:<br clear="none"><br clear="none">"Left(Str(hDate), 10) '(international)"<br clear="none"><br clear="none">I don't mean UTC but I mean "displaying the date in local format in all countries"<br clear="none">And when I write:<br clear="none"><br clear="none">"Format(hDate, "dd/mm/yyyy") '(Local)"<br clear="none"><br clear="none">I mean "displaying the date in local format only in your country"<br clear="none"><br clear="none">In my defense, I have attached a project that contains this code that better explains what I wanted to say:<br clear="none">-------------------------------------------<br clear="none">' From a Sotema code<br clear="none">Public Sub Main()<br clear="none"><br clear="none">  Dim hConn As Connection<br clear="none">  Dim hResult As Result<br clear="none">  Dim hTable As Table<br clear="none">  ' Activate the display of gb.db messages<br clear="none">  db.Debug = True<br clear="none">  ' Set the connection parameters<br clear="none">  With hConn = New Connection<br clear="none">    .Type = "sqlite"<br clear="none">    .Host = System.User.Home<br clear="none">    .Open<br clear="none">  End With<br clear="none">  ' if the db exists, delete it.<br clear="none">  ' this allows you to run the example several times<br clear="none">  If (hConn.Databases.Exist("exampledb")) Then<br clear="none">    hConn.Databases.Remove("exampledb")<br clear="none">    hConn.Databases.Add("exampledb")<br clear="none">  Endif<br clear="none">  hConn.Name = "exampledb"<br clear="none">  ' create the table<br clear="none">  hTable = hConn.Tables.Add("users")<br clear="none">  hTable.Fields.Add("id", db.Integer)<br clear="none">  hTable.Fields.Add("name", db.String, 80)<br clear="none">  hTable.Fields.Add("birth", db.Date)<br clear="none">  <br clear="none">  hTable.Update()<br clear="none">  ' add one record<br clear="none">  hConn.Begin()<br clear="none">  hResult = hConn.Create("users")<br clear="none">  hResult!id = 1<br clear="none">  hResult!name = "Gianluigi"<br clear="none">  hResult!birth = Date(1947, 4, 10)<br clear="none">  hResult.Update()<br clear="none">  hConn.Commit()<br clear="none">  ' retrieve the record<br clear="none">  hResult = hConn.Find("users") ' the same as  select * from users<br clear="none">  ' hResult = hConn.Exec("SELECT * FROM users")<br clear="none">  Print Left(Str(hResult["birth"]), 10)<br clear="none">  'Print Format(hResult["birth"], "dd/mm/yyyy")<br clear="none"><br clear="none">End<br clear="none">------------------------------------------<br clear="none"><br clear="none">and I had previously referred to ReportTest on the Software farm, that treats dates the same way.<div class="ydpff950f7byiv7657369545yqt8273959549" id="ydpff950f7byiv7657369545yqtfd00576"><br clear="none"><br clear="none">Regards</div><br clear="none">Gianluigi <div class="ydpff950f7byiv7657369545yqt8273959549" id="ydpff950f7byiv7657369545yqtfd95012"><br clear="none"></div></div></div></div></div></div><div class="ydpff950f7byqt8273959549" id="ydpff950f7byqtfd25798"><br clear="none">----[ Gambas mailing-list is hosted by <a shape="rect" href="https://www.hostsharing.net " rel="nofollow" target="_blank">https://www.hostsharing.net </a>]----<br clear="none"></div></div>
            </div>
        </div></body></html>