def normalize_date(curs, date_str, fmt, units='month', diff='0 months'):
    normalize_date_sql = \
    '''
    SELECT to_char(date_trunc(%s, %s::timestamp + %s), %s);
    '''
    curs.execute(normalize_date_sql, (units, date_str, diff, fmt))
    return curs.fetchone()[0]
Returns a tuple representation of this Geometry Collection.
dataset/ETHPy150Open mage2k/pg_partitioner/pg_partitioner/sql_util.py/normalize_date--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/django/contrib/gis/gdal/geometries.py/GeometryCollection.tuple