I am reading different log files with different date formats. I am using python to read in the files line by line and then parse the line. I want to parse the line for dates and then formulate them into a date object to do comparisons on.
For example, say that I have 2 log files both with different date formats. How do I read them into an object to compare them to a known date. Assume for example, I wanted to discard all dates before a certain time.
Let's assume the first log file just has one line:
invalid access 2015-01-04 14:23:15 on IP 5.5.5.5
How do I read in 2015-01-04 14:23:15
into a dateobject (so I can do comparisons)
What if the date format was different? How would I read in that?