Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 112237
Status: rejected
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.50
Fixed in: (no value)



Subject: strftime() appears to be broken
I suppose this could be a user error, as I'm new to SQL. But I don't see how: I get a null response when I try to use strftime(). But the corresponding time() function works as expected. (Same is true for the other named date/time functions.) # sqlite3 SQLite version 3.7.5 Enter ".help" for instructions Enter SQL statements terminated with a ";" Show quoted text
sqlite> select time( '1979-06-05 16:45:30' );
16:45:30 Show quoted text
sqlite> select strftime( '%T', '1979-06-05 16:45:30' );
Show quoted text
SQLite>
(Obviously, I want to use another format string in real life.) This seems like a serious bug... Unless I'm really confused.
On Mon Feb 22 00:49:06 2016, tlhackque wrote: Show quoted text
> I suppose this could be a user error, as I'm new to SQL. But I don't > see how: > > I get a null response when I try to use strftime(). But the > corresponding time() function works as expected. (Same is true for > the other named date/time functions.) > > # sqlite3 > SQLite version 3.7.5 > Enter ".help" for instructions > Enter SQL statements terminated with a ";"
> sqlite> select time( '1979-06-05 16:45:30' );
> 16:45:30
> sqlite> select strftime( '%T', '1979-06-05 16:45:30' );
>
> SQLite>
> > (Obviously, I want to use another format string in real life.) > > This seems like a serious bug... Unless I'm really confused.
Read the manual, please. strftime() function of SQLite supports only a subset of IS0-8601: http://www.sqlite.org/lang_datefunc.html Also, this is not an issue in DBD::SQLite perl module itself. If you have further SQL (or SQLite) questions, ask in the sqlite mailing list ( http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ) or somewhere like stackoverflow :)