So, I have a bunch of sqlite extension modules that I really should polish up for an official release Real Soon Now...
I just added a basic interface to the POSIX strptime() function to the string functions library: sqlite> .load ./libstring_funcs sqlite> select date(strptime('%m/%d/%Y', '10/08/2019'), 'unixepoch') AS today; today ---------- 2019-10-08 If anyone thinks they'd find it handy, the project lives at https://github.com/shawnw/useful_sqlite_extensions/ On Tue, Oct 8, 2019 at 5:46 AM Hick Gunter <h...@scigames.at> wrote: > What it boils down to is asking the data storage layer to perform a > presentation layer task. > > If you insist on solving the problem inside an SQL statement, you can > always write your own extension function to "easily" perform the necessary > conversion. > > -----Ursprüngliche Nachricht----- > Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > Im Auftrag von Jose Isaias Cabrera > Gesendet: Dienstag, 08. Oktober 2019 14:32 > An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Betreff: [EXTERNAL] Re: [sqlite] Date time input > > > Jens Alfke, on Monday, October 7, 2019 09:18 PM, wrote... > [clip] > > <grumpy>I swear, half the questions on this list build down to "Why > > doesn't SQLite act like MS Access?" If you need all the bells and > > whistles of formatting input and output, then use a fancy DBMS > > application. SQLite is for embedded use _inside_ > > applications.</grumpy> > > No, that is not what I was trying to say or ask. Not even close. What I > was trying to say, and most of you missed it was, that if I give date a > date format, and I also provide the format of how that date is to be > understood, ie. > > date('5/22/2019','m/d/yyyy') > > where the date is the first entry, '5/22/2019', and the format is the > second entry, 'm/d/yyyy', that SQLite could take that set of data and > easily convert and return the ISO date I want. Yes, I know I can write > that outside the code, or inside in SQL, but "it would be nice to have > this." Thanks for all the responses. > > josé > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > ___________________________________________ > Gunter Hick | Software Engineer | Scientific Games International GmbH | > Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) > +43 1 80100 - 0 > > May be privileged. May be confidential. Please delete if not the addressee. > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users