Re: [sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread teoh
nope. that doesnt work either. i got no problem outputing other recoard. but got problem with strftime('%s', 'now') --- Jeff Thompson <[EMAIL PROTECTED]> wrote: > On Tue, 1 Feb 2005 06:51:49 -0800 (PST), teoh > <[EMAIL PROTECTED]> wrote: > > > > sqlite3::reader reader=con.executereader("select

Re: [sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread Doug Currie
> create table each_transaction(datetime int); > insert into each_transaction values( datetime('%s', 'now')); Perhaps you should say insert into each_transaction values( strftime('%s', 'now')); ? http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions e > this is how I create table

Re: [sqlite] bogus output for strftime('%s', 'now') ermm..

2005-02-01 Thread Jay
Did you try this? create table each_transaction(datetime text); insert into each_transaction(datetime) values(datetime('now')); D:\temp\convention>sqlite3 test.db SQLite version 3.0.8 Enter ".help" for instructions sqlite> create table each_transaction(datetime text); sqlite> insert into

Re: [sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread Jeff Thompson
On Tue, 1 Feb 2005 06:51:49 -0800 (PST), teoh <[EMAIL PROTECTED]> wrote: > > sqlite3::reader reader=con.executereader("select * > from each_transaction;"); > while(reader.read()) > {cout << reader.getcolname(0) << ": " << > reader.getstring(0) << endl; } > > I get output like this: > >

Re: [sqlite] bogus output for strftime('%s', 'now') ermm..

2005-02-01 Thread teoh
nope. reader.getint32(0) will return 0 i tried changed datetime to "text" and did the query by getsring(0) and i get same invalid output output: รก " i still cant use strftime('%s', 'now') . --- [EMAIL PROTECTED] wrote: > teoh <[EMAIL PROTECTED]> writes: > > > create table

Re: [sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread Derrell . Lipman
teoh <[EMAIL PROTECTED]> writes: > create table each_transaction(datetime int); > > insert into each_transaction values( datetime('%s', > 'now')); > > this is how I create table and insert the > strftime('%s', 'now'). But when I did query with > sql3_plus. > > sqlite3::reader

Re: [sqlite] bogus output for strftime('%s', 'now') .errm..

2005-02-01 Thread teoh
what i trying to say is, i cant use strftime('%s', 'now') but also to use other function like datetime('now') . This is because the output of select will be invalid. if i use datetime('now') . the output is 2005-02-01 15:44:23 . How does the "select" statement should look like if i want it to

Re: [sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread Jay
Does this fix it? insert into each_transaction(datetime) values(datetime('now')); --- teoh <[EMAIL PROTECTED]> wrote: > > create table each_transaction(datetime int); > > insert into each_transaction values( datetime('%s', > 'now')); > > this is how I create table and insert the >

[sqlite] bogus output for strftime('%s', 'now')

2005-02-01 Thread teoh
create table each_transaction(datetime int); insert into each_transaction values( datetime('%s', 'now')); this is how I create table and insert the strftime('%s', 'now'). But when I did query with sql3_plus. sqlite3::reader reader=con.executereader("select * from each_transaction;");