<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi David,<br>
      <br>
      Can you create and post some code that demonstrates the problem.
      That will give us something to work with.<br>
      <br>
      Charlie<br>
      <br>
      On 16/05/2019 15:16, David Silverwood via User wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1223093897.468141.1558016173799@mail.yahoo.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div class="ydp6791a4fdyahoo-style-wrap" style="font-family:
        Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;">
        <div>Ok, so I'm back with the same problem. It seems to me
          Gambas has a template format for a date and trying to change
          it is impossible? As soon as Gambas sees it as a date, it
          reformats my formatting back to the incorrect format and
          renders all the code useless. Is this the way it is supposed
          to be? </div>
        <div><br>
        </div>
        <div>I need my date formatted to sqlite format, eg, yyyy-mm-dd</div>
        <div><br>
        </div>
        <div>However, soon as I do that, gambas switches it to
          mm/dd/yyyy.</div>
        <div><br>
        </div>
        <div>My OS regional settings are correct. Using Mint 18.3 KDE
          and Gambas 3.13 (Thanks Charlie for the upgrade tip)</div>
        <div><br>
        </div>
        <div>The latter format is useless over here and inevitably
          gambas reads the day and month wrong, by switching it... I've
          tried using Split and in a debug /print statement I see that
          it does do exactly what I need, but once the format hits the
          textbox, Gambas actually changes it back to mm/dd/yyyy. How do
          I stop that? I tried DIM'ing the dates as Strings but Gambas
          seems to read dates as dates even if they are dimensioned as
          strings? (which I know they are 'special' strings of course).</div>
        <div><br>
        </div>
        <div>My sqlite3 database complains whenever I try and save the
          dates in Gambas's preferred format.</div>
        <div><br>
        </div>
        <div>I know I am doing something wrong since no one else has
          this issue.... but what?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div id="ydpe15f8925yahoo_quoted_8492039099"
        class="ydpe15f8925yahoo_quoted">
        <div style="font-family:'Helvetica Neue', Helvetica, Arial,
          sans-serif;font-size:13px;color:#26282a;">
          <div> On Tuesday, April 30, 2019, 11:05:06 AM GMT+2, David
            Silverwood via User <a class="moz-txt-link-rfc2396E" href="mailto:user@lists.gambas-basic.org"><user@lists.gambas-basic.org></a>
            wrote: </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>
            <div id="ydpe15f8925yiv7748707307">
              <div>
                <div
                  class="ydpe15f8925yiv7748707307ydp65c9a003yahoo-style-wrap"
                  style="font-family:Helvetica Neue, Helvetica, Arial,
                  sans-serif;font-size:13px;">
                  <div>Thank you very much Charlie and Gianluigi. Those
                    were pointers in the right direction for me! I
                    really appreciate your help. (Not to mention I just
                    learned a lot from both of your code too.)</div>
                  <div><br clear="none">
                  </div>
                  <div><br clear="none">
                  </div>
                </div>
                <div
                  class="ydpe15f8925yiv7748707307ydp8cad57bbyahoo_quoted"
id="ydpe15f8925yiv7748707307ydp8cad57bbyahoo_quoted_6751442980">
                  <div style="font-family:'Helvetica Neue', Helvetica,
                    Arial, sans-serif;font-size:13px;color:#26282a;">
                    <div class="ydpe15f8925yiv7748707307yqt7436755736"
                      id="ydpe15f8925yiv7748707307yqt92555">
                      <div> On Monday, April 29, 2019, 7:24:06 PM GMT+2,
                        Charlie Ogier <a class="moz-txt-link-rfc2396E" href="mailto:charlie@cogier.com"><charlie@cogier.com></a> wrote:
                      </div>
                      <div><br clear="none">
                      </div>
                      <div><br clear="none">
                      </div>
                      <div>
                        <div
                          id="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190">
                          <div>
                            <div
                              class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190moz-cite-prefix">Hi
                              David,<br clear="none">
                              <br clear="none">
                              Try this code: -<br clear="none">
                              <br clear="none">
                              Dim dDate As Date<br clear="none">
                              Dim sDate As New String[]<br clear="none">
                              <br clear="none">
                              edtDate.Text = "2019-04-29"         'I
                              presume this is the format you get so you
                              can take this line out. It was for me to
                              test.<br clear="none">
                              <br clear="none">
                              If edtDate.Text Then<br clear="none">
                                sDate = Split(edtDate.Text, "-")<br
                                clear="none">
                                dDate = Date(sDate[0], sDate[1],
                              sDate[2])<br clear="none">
                                edtDate.Text = Format$(dDate,
                              "dd/mm/yyyy")<br clear="none">
                              Endif<br clear="none">
                              <br clear="none">
                              If you use the ppa you can have the latest
                              version of Gambas. Run the following
                              command in Terminal and Gambas 3.13.0 will
                              install. You will need a reasonable
                              internet connection.<br clear="none">
                              <br clear="none">
                              <span style="color:rgb(0, 0,
0);font-family:Ubuntu;font-size:medium;font-style:normal;font-weight:400;letter-spacing:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;text-decoration-color:initial;display:inline
                                !important;float:none;">sudo
                                add-apt-repository -y
                                ppa:gambas-team/gambas3 && sudo
                                apt-get update && sudo apt-get
                                -y install gambas3<span> </span></span><br
                                style="color:rgb(0, 0,
0);font-family:Ubuntu;font-size:medium;font-style:normal;font-weight:400;letter-spacing:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;text-decoration-color:initial;"
                                clear="none">
                              <br clear="none">
                              Hope that helps,<br clear="none">
                              <br clear="none">
                              Charlie<br clear="none">
                              <br clear="none">
                              On 29/04/2019 14:40, David Silverwood via
                              User wrote:<br clear="none">
                            </div>
                            <blockquote type="cite"> </blockquote>
                          </div>
                          <div>
                            <div
                              class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190yqt1933288209"
id="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190yqt05380">
                              <div
                                class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190yahoo-style-wrap"
                                style="font-family:Helvetica Neue,
                                Helvetica, Arial,
                                sans-serif;font-size:13px;">
                                <div>Hi</div>
                                <div>I'm new to the forum so please
                                  forgive any mistakes in protocol. I am
                                  also pretty new to Gambas and have a
                                  lot to learn, so please forgive once
                                  again any stupid questions or
                                  mistakes.</div>
                                <div>Am trying to get Gambas dates to
                                  work for me. I have a SQLite3 database
                                  and as we know SQLite dates are stored
                                  as YYYY-MM-DD. It seems Gambas dates
                                  are stored MM-DD-YYYY which in South
                                  Africa doesn't work as our local dates
                                  are stored dd-mm-yyyy. Now, when I
                                  format$ my dateboxes/textboxes to read
                                  yyyy-mm-dd, depending on the date, I
                                  either get a blank box or the month
                                  and day are swopped and therefore also
                                  renders the date unusable here. </div>
                                <div>My localisation settings for Linux
                                  Mint 18.3 KDE are correct.</div>
                                <div>How can I convince Gambas to use
                                  the local date settings or at least
                                  format the date to the 'correct'
                                  format for our area?</div>
                                <div><br clear="none">
                                </div>
                                <div>The problem occurs when I load the
                                  dates from the database and try and
                                  format the dates to 'yyyy-mm-dd' using</div>
                                <div><span> </span>
                                  <div>  If edtDate.Text Then</div>
                                  <div>    dDate = Val(edtDate.Text)</div>
                                  <div>    edtDate.Text = Format$(dDate,
                                    "yyyy-mm-dd")</div>
                                  <div>  Endif</div>
                                  <br clear="none">
                                </div>
                                <div>Any but any suggestions/directions
                                  would be much appreciated.</div>
                                <div><br clear="none">
                                </div>
                                <div>Thanks</div>
                                <div><br clear="none">
                                </div>
                                <div>David</div>
                              </div>
                            </div>
                            <br clear="none">
                            <fieldset
class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190mimeAttachmentHeader"></fieldset>
                            <pre class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190moz-quote-pre">----[ Gambas mailing-list is hosted by <a shape="rect" class="ydpe15f8925yiv7748707307ydp8cad57bbyiv4049803190moz-txt-link-freetext" href="https://www.hostsharing.net" rel="nofollow" target="_blank" moz-do-not-send="true">https://www.hostsharing.net</a> ]----
</pre>
                            <br clear="none">
                          </div>
                        </div>
                        <div
                          class="ydpe15f8925yiv7748707307ydp8cad57bbyqt1933288209"
id="ydpe15f8925yiv7748707307ydp8cad57bbyqt38177"><br clear="none">
                          ----[ Gambas mailing-list is hosted by <a
                            shape="rect"
                            href="https://www.hostsharing.net "
                            rel="nofollow" target="_blank"
                            moz-do-not-send="true">https://www.hostsharing.net
                          </a>]----<br clear="none">
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="ydpe15f8925yqt7436755736"
              id="ydpe15f8925yqt25888"><br clear="none">
              ----[ Gambas mailing-list is hosted by <a shape="rect"
                href="https://www.hostsharing.net " rel="nofollow"
                target="_blank" moz-do-not-send="true">https://www.hostsharing.net
              </a>]----<br clear="none">
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
----[ Gambas mailing-list is hosted by <a class="moz-txt-link-freetext" href="https://www.hostsharing.net">https://www.hostsharing.net</a> ]----
</pre>
    </blockquote>
    <br>
  </body>
</html>