from datetime import datetime


def datefix(datestr):
    """ transform string into a python datetime object 
        handle mm/dd/yy or mm/dd/yyyy or dashes instead of slashes """
    fix = datestr.replace('-','/')
    if len(fix) > 4:
        try:
            return datetime.strptime(fix, "%m/%d/%y")
        except ValueError:
            return datetime.strptime(fix, "%m/%d/%Y")
    return datetime.utcnow()