from datetime import datetime


datetime1 = "2016-04-19 01:25:09.9090"
datetime1 = datetime.strptime(datetime1, "%Y-%m-%d %H:%M:%S.%f") # Converts 
string to datetime object

datetime2 = "2016-04-19 01:25:09.8765"
datetime2 = datetime.strptime(datetime2, "%Y-%m-%d %H:%M:%S.%f") # Converts 
string to datetime object

difference = (datetime1 - datetime2).seconds # Difference between the two 
datetimes in seconds


-- 
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.

Reply via email to