from datetime import datetime


def parse_datetime(task):
    """ Parse the datetime strings given to us by `task export` """

    for key in ['entry', 'end']:
        if key in task:
            task[key] = datetime.strptime(task[key], "%Y%m%dT%H%M%SZ")
    return task