from datetime import datetime


def convert_string_to_datetime_obj(x, fmt):
    """
    :param x: str (can be any kind of date/time related string format)
    :param fmt: format of output
    :return: datetime object
    """
    if type(x) == str:
        return datetime.strptime(x, fmt)
    else:
        return ''