On Tuesday, June 23, 2015 at 8:43:01 AM UTC-7, icodk wrote:
> > rows=db((todayseconds+db.checkpoint.check_time.epoch()>(nowseconds-300)&(todayseconds+db.checkpoint.check_time.epoch()<=nowseconds))).select() > > 5. The problem is that the DAL will not take the: > todayseconds+db.checkpoint.check_time.epoch() expression. > TypeError: unsupported operand type(s) for +: 'int' and 'Expression' > > > An alternative can be to 'fix' the current time to the number of seconds > from the beginning of today and if the nowseconds-300 <0 then to add 86400 > and to use this number instead of the low limit: nowseconds-300 > The only reference to "epoch" in the Web2py book it to Python's time.time() function. Do time.time() and time.strptime() help you at all? (If you're storing the date in the database as as a datetime, time.strptime() may handle the conversion to compare to time.time().) If that's not useful, maybe you could show your field definitions, and the check_time() code? /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.