Preheat the oven to 400°. Butter a 9-by-13-inch baking dish. Layer one-fourth of the potatoes in the baking dish. Season generously with salt and pepper and sprinkle with some of the rosemary and thyme. Layer one-third of the onion over the potatoes and dot with some of the butter. Continue layering the remaining potatoes and onion, seasoning them with salt, pepper, rosemary and thyme and dotting with butter; end with a layer of potatoes. Combine the heavy cream and milk and pour over the potatoes. Dot the top with any remaining butter.