import time


def convert_time(longTime):
    """
    Ignore time of day to help with grouping contributions by day.
    2018-01-03 00:00:00 --> 2018-01-03
    """
    try:
        t = time.strptime(longTime, "%Y-%m-%d %H:%M:%S")
    except ValueError:
        return longTime
    ret = time.strftime( "%Y-%m-%d", t)
    return ret