I can't remember - we did it when I was a kid sometimes. I don't remember my mum getting it out of the fridge beforehand, so I think we just did it straight from the fridge. You can also end up with butter if you put cream in your mixer to whip it, and leave it too long.... that's always cold when I whip it, so i don't think the temperature can be important.
my dad made me and my sister do this on special occasions (xmas, relatives coming over) when they wanted us to be quiet and keep out of the way for a while. I remember we used to spend all xmas morning shaking a jar of milk / butter . It was very tasty.