strptime()

A Python function that turns a date and time written as text into a datetime object, using a format pattern such as %b %d %H:%M:%S.

In more detail

Parsing "Mar 2 01:22:10" from an auth log with strptime gives a time with no year and no time zone, so the code must add both explicitly. Getting that wrong shifts events by hours and breaks correlation.

Related terms

Taught in

References