app/util/round_time.py
def round_month_up(origin_date):
    """
    Takes a datetime object and rounds up to the nearest month.
    E.g. 2/14/2013 becomes 3/1/2013
    :param datetime.datetime origin_date:
    :return datetime.datetime:
    """
    from datetime import datetime
    from datetime import timedelta
    day = origin_date.day
    month = origin_date.month
    year = origin_date.year
    if origin_date.month == 12:
        delta = datetime(year + 1, 1, day) - origin_date
    else:
        delta = datetime(year, month + 1, day) - origin_date
    return origin_date + delta - timedelta(days=day - 1)

    Takes a datetime object and rounds up to the nearest month.
    E.g. 2/14/2013 becomes 3/1/2013
    :param datetime.datetime origin_date:
    :return datetime.datetime:
    
Takes a datetime object and rounds up to the nearest month.
Takes a datetime object and rounds up to the nearest month .
def round_month_up(origin_date):
    from datetime import datetime
    from datetime import timedelta
    day = origin_date.day
    month = origin_date.month
    year = origin_date.year
    if origin_date.month == 12:
        delta = datetime(year + 1, 1, day) - origin_date
    else:
        delta = datetime(year, month + 1, day) - origin_date
    return origin_date + delta - timedelta(days=day - 1)
def round_month_up ( origin_date ) : from datetime import datetime from datetime import timedelta day = origin_date . day month = origin_date . month year = origin_date . year if origin_date . month == 12 : delta = datetime ( year + 1 , 1 , day ) - origin_date else : delta = datetime ( year , month + 1 , day ) - origin_date return origin_date + delta - timedelta ( days = day - 1 )
Takes a datetime object and rounds up to the nearest month.
Takes a datetime object and rounds up to the nearest month .
"""
    Takes a datetime object and rounds up to the nearest month.
    E.g. 2/14/2013 becomes 3/1/2013
    :param datetime.datetime origin_date:
    :return datetime.datetime:
    """
None
datetime.datetime
origin_date
None