def day_to_month ( timeperiod ) : t = datetime . strptime ( timeperiod , SYNERGY_DAILY_PATTERN ) return t . strftime ( SYNERGY_MONTHLY_PATTERN )
siomplify datetime to months python
: param timeperiod : as string in YYYYMMDD00 format : return string in YYYYMM0000 format
def day_to_month(timeperiod):
    """:param timeperiod: as string in YYYYMMDD00 format
    :return string in YYYYMM0000 format"""
    t = datetime.strptime(timeperiod, SYNERGY_DAILY_PATTERN)
    return t.strftime(SYNERGY_MONTHLY_PATTERN)