from datetime import datetime


def handle_unserializable_data(obj):
    """
    Handles objects which cannot be serialized by json.dumps()
    :param obj: Object to be serialized
    :return: JSON representation of the object
    """
    if isinstance(obj, datetime):
        return obj.__str__()