I have a sqlite database with a datatime field called last_accessed and another field called stale.
我如何更新超过5分钟的记录的渠道?
e.g.
这似乎不可行。
• 更新我的板块结构,其中(现为)——最后是获得;300;
In fact select datetime( now ) - 2011-02-22 08:48:34 ; returns 0.
我怎样做算术?
EDIT: Since I m converting last_accessed to a datetime and really it just needs to be a seconds field. Do you think I should convert that field to seconds field instead. Then I won t need to do something like strftime( %s ,time( now )) - strftime( %s ,last_accessed)?
Edit2: There is no difftime function as far as I can tell. I discovered you have to use strftime( %s , datetime( now )) - ... format to make it work. However, instead I ve converted simply to an integer field where I m storing time(NULL) directly.