Handling date time


I am working with sqlite database. I have to insert datetime data in table, but data is inserted as undifined.


[“CREATE TABLE Purchase(‘PSupCd’,‘Pr_indno’,‘Pr_milpurno’,‘Pr_mode’,‘Pr_var’,‘Pr_var_type’,‘Pr_vill’,‘Pr_Farmer’,‘P_Gr_wt’,‘P_tr_wt’,‘P_bind_wt’,Pr_Date DATETIME,‘Pr_send’,‘Pr_Seed_cd’ , PRIMARY KEY(‘Pr_indno’));”];

please provide guideline in brief that how can handle date and time features.

Hi, DateTime format are not supported in SQLITE according to the current documentation:


Anyways, in the document they say that there are some built in functions that to be honest I never tried. What I normally do, is to handle two fields (one for date and one for time, but I can put it together). Both are text, and since the time is only for information purposes for me I stored as: hh:mm:ss on a 24 hrs format. For the date I use YYYMMDD. In this way is easy to make comparisons to check if a date is greater than another.

Hope this helps.


Thanks for reply. I shall try as you advised.