[sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-23 Thread Pete
, 2 Apr 2012 20:38:37 +0400 From: Alexey Pechnikov pechni...@mobigroup.ru To: sqlite-users@sqlite.org Subject: [sqlite] Suggestion about hard-coded time string format -MM-DD Message-ID: CANMYFJn6nktjH=mgbgpp6dx6nyzva7scsesnuv4gk0xnazf...@mail.gmail.com Content-Type: text

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-23 Thread Igor Tandetnik
On 4/23/2012 2:34 PM, Pete wrote: Folks, I'm a bit late to this discussion but what are the new PRAGMAs referred to here? They were discussed hypothetically. As in, wouldn't it be nice if there were pragmas to control date and time formats. -- Igor Tandetnik

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-20 Thread Yves Goergen
On 02.04.2012 18:38 CE(S)T, Alexey Pechnikov wrote: Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565cv2=720cb1015e95af7a I think the new pragmas DATEFORMAT and TIMEFORMAT will be helpful

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-12 Thread Alexey Pechnikov
2012/4/2 Jay A. Kreibich j...@kreibi.ch It would make more sense to just implement a strptime() SQL function to compliment the existing strftime() function. That would allow SQLite to understand and convert any incoming date-time format without depending on specific build parameters.

[sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565cv2=720cb1015e95af7a I think the new pragmas DATEFORMAT and TIMEFORMAT will be helpful for internationalization. These may be used for parsing

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 5:38pm, Alexey Pechnikov pechni...@mobigroup.ru wrote: Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565cv2=720cb1015e95af7a I think the new pragmas DATEFORMAT and

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jay A. Kreibich
On Mon, Apr 02, 2012 at 08:38:37PM +0400, Alexey Pechnikov scratched on the wall: Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565cv2=720cb1015e95af7a I think the new pragmas DATEFORMAT

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
2012/4/2 Simon Slavin slav...@bigfraud.org Please see http://www.sqlite.org/lang_datefunc.html and you will be frustrated because SQLite can format date/time to different string formats but can't read the produced date/time strings. -- Best regards, Alexey Pechnikov. http://pechnikov.tel/

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 6:18pm, Alexey Pechnikov pechni...@mobigroup.ru wrote: Please see http://www.sqlite.org/lang_datefunc.html and you will be frustrated because SQLite can format date/time to different string formats but can't read the produced date/time strings. I am not frustrated. That

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Richard Hipp
On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin slav...@bigfraud.org wrote: I think ... a higher priority than that would be handling Unicode correctly. And having Unicode support would be useful in writing the code which handles dates. size of SQLite library: approx 500 KB size of ICU

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why you need ICU library to parse datetime strings?!! The my previous patch to parse Russian dates has only single row without any external libs. 2012/4/2 Richard Hipp d...@sqlite.org On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin slav...@bigfraud.org wrote: I think ... a higher priority

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 7:25pm, Richard Hipp d...@sqlite.org wrote: On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin slav...@bigfraud.org wrote: I think ... a higher priority than that would be handling Unicode correctly. And having Unicode support would be useful in writing the code which handles

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp d...@sqlite.org wrote: On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin slav...@bigfraud.org wrote: I think ... a higher priority than that would be handling Unicode correctly.  And having Unicode support would be useful in writing the code which

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
And see too: # LANG=C aptitude show libunistring0 Package: libunistring0 New: yes State: not installed Version: 0.9.3-3 Priority: optional Section: libs Maintainer: Andreas Rottmann ro...@debian.org Uncompressed Size: 1221 k Depends: libc6 (= 2.3) Description: Unicode string library for C The

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 3:58 PM, Alexey Pechnikov pechni...@mobigroup.ru wrote: And see too: Homepage: http://www.gnu.org/software/libunistring/ Thanks! That looks like a dream come true (even if LGPL). It's much more complete than the OpenSolaris u8_textprep stuff, which would be

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 9:58pm, Alexey Pechnikov pechni...@mobigroup.ru wrote: Description: Unicode string library for C The 'libunistring' library implements Unicode strings (in the UTF-8, UTF-16, and UTF-32 encodings), together with functions for Unicode characters (character names,

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:24pm, Simon Slavin slav...@bigfraud.org wrote: On 2 Apr 2012, at 9:58pm, Alexey Pechnikov pechni...@mobigroup.ru wrote: Description: Unicode string library for C The 'libunistring' library implements Unicode strings (in the UTF-8, UTF-16, and UTF-32 encodings),

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Igor Tandetnik
On 4/2/2012 5:34 PM, Simon Slavin wrote: Hmm. It's there: http://www.gnu.org/software/libunistring/manual/libunistring.html#unistr_002eh The following function compares two Unicode strings of possibly different lengths. — Function: int u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jean-Christophe Deschamps
At 23:44 02/04/2012, you wrote: I wonder whether it respects languages. These don't, but u8_strcoll et al supposedly do, based on LC_COLLATE locale category. Herein lies the problem: if you build an index using these functions while running under locale A, then try to run queries against

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 4:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 2 Apr 2012, at 9:58pm, Alexey Pechnikov pechni...@mobigroup.ru wrote: Description: Unicode string library for C The 'libunistring' library implements Unicode strings (in the UTF-8, UTF-16, and UTF-32 encodings),

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp d...@sqlite.org wrote: On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin slav...@bigfraud.org wrote: I think ... a higher priority than that would be handling Unicode correctly.  And having Unicode support would be useful in writing the code which

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:44pm, Igor Tandetnik itandet...@mvps.org wrote: On 4/2/2012 5:34 PM, Simon Slavin wrote: Hmm. It's there: http://www.gnu.org/software/libunistring/manual/libunistring.html#unistr_002eh The following function compares two Unicode strings of possibly different

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 5:46 PM, Simon Slavin slav...@bigfraud.org wrote: Replace part of that routine with something which specifies the locale rather than fetching it from OS settings.  And store the locale used with the index, as a COLLATE setting.  Thus leaving it up to whoever writes the

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/04/12 14:34, Simon Slavin wrote: I wonder whether it respects languages. A German user living in France has some Swedish names in their list to be sorted. Do you use Swedish sort order, German sort order, German name order or French order?