def __format_dst_change(cls, dst_change): if dst_change['day'].startswith('D'): return '%02d/%02d/%02d' % (dst_change['month'], dst_change['day'][1:], dst_change['time'].as_hour) else: week, weekday = map(int, dst_change['day'][1:].split('.')) weekday = tzinform.week_start_on_monday(weekday) return '%d/%d/%d/%d' % (dst_change['month'], week, weekday, dst_change['time'].as_hours)
def __format_dst_change(cls, dst_change): fmted_time = '%02d:%02d:%02d' % tuple(dst_change['time'].as_hms) day = dst_change['day'] if day.startswith('D'): return '%02d.%02d %s' % (int(day[1:]), dst_change['month'], fmted_time) else: week, weekday = map(int, day[1:].split('.')) weekday = tzinform.week_start_on_monday(weekday) return '%02d.%02d.%02d %s' % (dst_change['month'], week, weekday, fmted_time)
def __format_dst_change(cls, dst_change): _day = dst_change['day'] if _day.startswith('D'): day = _day[1:] weekday = '0' else: week, weekday = _day[1:].split('.') weekday = tzinform.week_start_on_monday(int(weekday)) if week == '5': day = '-1' else: day = (int(week) - 1) * 7 + 1 h, m, s = dst_change['time'].as_hms return ('%s/%s/%s/%s:%s:%s' % (dst_change['month'], day, weekday, h, m, s))