tags:

views:

88

answers:

1

I want insert the current date and time into my table.... I used this query

insert into tbl_reminder values("Description",current_timestamp);

but it insert the wrong time... actually the timestamp in my emulator is 2010-09-16 18:40:06 but the inserted timestamp value is 2010-09-16 13:10:06 what i do to insert the exact time...

A: 

Insert it enclosed within Quotes, the date will be stored as a string.

sqlite doesn't has a Date datatype.

Now, the following is just incase you are planning to use the Date column for Comparisions...

Speaking from experience, i would advice you store it as Long Integer, as a Unix Timestamp, it lets you do Comparison between dates, which would otherwise be very difficult.

You'll obviously have to convert it to-and-fro but in the long run it's a better stratergy.

st0le