def format_tags(time, tag_key, frequency, resource_type):
    """
    Format the tags for ec2 and rds
    Args:
        time: integer representing hour in utc
        tag_key: tag key on-hours or off-hours
        frequency: day from M, T, W, H, F, S, U. Can be range M-F
        resource_type: ec2 or rds
    """
    if resource_type == "rds":
        tag_value = f"{frequency}/{time}:tz=utc:"
    else:
        tag_value = f"({frequency},{time});tz=utc;"
    return {f"{tag_key}": f"{tag_value}"}