Works with time with/without seconds.

def str2dt(s):
    """Works with time with/without seconds."""
    return datetime.datetime.strptime(s, _FMTS if s.count(":") == 2 else _FMT if s.count(":") == 1 else _FMT0)