You can compare time here by using the relational operators. Access the
current time by using 'request.now' (its value will be in same format as
'update_on' field of your table) then you can just compare it as :
if (dbquery).updated_time > request.now:
//do something
On Thursday, July 19, 2012 at 2:35:41 PM UTC+5:30, Amit wrote:
>
> Hi,
> I have some records in a table and each record is having one field of type
> datetime [fromat : 2012-07-19 23:12:0 (YYYY-MM-DD HH:MM:SS)], table
> structure is:
>
> Emp_ID
> Emp_Name
> Emp_Address
> Emp_Salary
> updated_on(Type: datetime)
>
> periodically getting data against each Emp_ID and updating to the
> particular record, every 20 mins data has to be updated for each Emp_ID,
> for e.g : suppose for one Emp_ID data has updated on 2012-07-19 10:10:00
> then again it has to update on 2012-07-19 10:30:00 etc...
>
> and if data is not updated in 20 mins then one scheduler will verify
> against the updated_on column value and inform user that data has not
> updated for particular employee.
>
> Problem facing:
> How to compare current datetime with updated_on coulmn value in web2py?
> can anybody please share me the code to achieve the same?
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.