I am working on a log type application in Python. The application basically allows the user to write log entries and adds a timestamp for a subsequent log request.
I am currently using the function time.ctime()to generate temporary stamps that are visually friendly. Thus, the log entries are as follows:
Thu Jan 21 19:59:47 2010 Did something
Thu Jan 21 20:01:07 2010 Did something else
Now, I would like to be able to use these timestamps to perform some searches / queries. I need to be able to search, for example, for "2010", or "feb 2010", or "February 23, 2010".
My questions:
1) What time module should be used: timevs datetime?
2) What would be a suitable way to create and use timestamp objects?
Many thanks!
source
share