You should be using single quotes for string delimiters. Additionally, you are 
seeing right handed truncation of a 5 character string in a 4 character field

asql> select strftime('%Y','-0123-04-05');
strftime('%Y','-0123-04-05')
----------------------------
-123


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Tanaka Akira
Sent: Dienstag, 16. Juli 2019 14:08
To: sqlite-users@mailinglists.sqlite.org
Subject: [EXTERNAL] [sqlite] strftime("%Y", "-1234-01-01") returns -123

Hi.
I found a doubtful behavior of strftime("%Y").

strftime("%Y", "-1234-01-01") returns -123 but I feel it should be -1234.
(But it can be error because the manual describes "%Y year: 0000-9999".)

% ./sqlite3
SQLite version 3.29.0 2019-07-10 17:32:03 Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> SELECT strftime("%Y", "-1234-05-06");
-123
sqlite>
% ./sqlite3 -version
3.29.0 2019-07-10 17:32:03
fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6

I built sqlite3 from sqlite-autoconf-3290000.tar.gz downloaded today.

% ls ..
sqlite-autoconf-3290000  sqlite-autoconf-3290000.tar.gz
--
Tanaka Akira
_______________________________________________
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

Reply via email to