<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 17 mag 2019 alle ore 21:44 Benoît Minisini <<a href="mailto:g4mba5@gmail.com">g4mba5@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
As I notice that almost nobody suceeds in dealing with date & time <br>
correctly, I started to wrote a overview about that in the wiki.<br>
<br>
<a href="http://gambaswiki.org/wiki/doc/date" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/date</a><br>
<br>
Please feal free to comment and modify this page so that date & time <br>
management becomes as clear as possible.<br>
<br>
This is still a work in progress, and I especially need "how to" code <br>
example about dates.<br>
<br>
Regards,<br>
<br>
-- <br>
Benoît Minisini<br></blockquote><div><br></div><div><br></div><div>Hi Benoit,<br>probably could have inspired what I wrote here:<br><br><a href="https://lists.gambas-basic.org/pipermail/user/2019-May/067200.html">https://lists.gambas-basic.org/pipermail/user/2019-May/067200.html</a><br><br>In fact when I write:<br><br>"Left(Str(hDate), 10) '(international)"<br><br>I don't mean UTC but I mean "displaying the date in local format in all countries"<br>And when I write:<br><br>"Format(hDate, "dd/mm/yyyy") '(Local)"<br><br>I mean "displaying the date in local format only in your country"<br><br>In my defense, I have attached a project that contains this code that better explains what I wanted to say:<br>-------------------------------------------<br>' From a Sotema code<br>Public Sub Main()<br><br> Dim hConn As Connection<br> Dim hResult As Result<br> Dim hTable As Table<br> ' Activate the display of gb.db messages<br> db.Debug = True<br> ' Set the connection parameters<br> With hConn = New Connection<br> .Type = "sqlite"<br> .Host = System.User.Home<br> .Open<br> End With<br> ' if the db exists, delete it.<br> ' this allows you to run the example several times<br> If (hConn.Databases.Exist("exampledb")) Then<br> hConn.Databases.Remove("exampledb")<br> hConn.Databases.Add("exampledb")<br> Endif<br> hConn.Name = "exampledb"<br> ' create the table<br> hTable = hConn.Tables.Add("users")<br> hTable.Fields.Add("id", db.Integer)<br> hTable.Fields.Add("name", db.String, 80)<br> hTable.Fields.Add("birth", db.Date)<br> <br> hTable.Update()<br> ' add one record<br> hConn.Begin()<br> hResult = hConn.Create("users")<br> hResult!id = 1<br> hResult!name = "Gianluigi"<br> hResult!birth = Date(1947, 4, 10)<br> hResult.Update()<br> hConn.Commit()<br> ' retrieve the record<br> hResult = hConn.Find("users") ' the same as select * from users<br> ' hResult = hConn.Exec("SELECT * FROM users")<br> Print Left(Str(hResult["birth"]), 10)<br> 'Print Format(hResult["birth"], "dd/mm/yyyy")<br><br>End<br>------------------------------------------<br><br>and I had previously referred to ReportTest on the Software farm, that treats dates the same way.<br><br>Regards<br>Gianluigi <br></div></div></div>