import re
from datetime import datetime


def string_to_datetime(datestring):
    """Converts a date/time string as output by OpenVAS into a Python datetime object."""
    a = list(map(int, re.sub("[^0-9]", ' ', datestring).split()))
    return datetime(a[0], a[1], a[2], a[3], a[4], a[5])