They are determined when you recieve the Pokemon revived. In B/W I had an Archen with an awful nature. I shut my game off and received it again; it had a different nature. So, again It's determined when you get the revived form.
Source: Experience and two online sources that said so.
I lost the other one, sorry.