Do they know this is a possibility? If not, I would say a month is more than enough. If they know its a possibility I think its fine to tell them whenever your comfortable, even if its more than a month.
When my DH and I moved cross country a few years ago they knew it was coming so as soon as I knew I told them approximately when I would be leaving and then gave them exacts when it got closer.
These things happen and while they'll probably be disappointed they will understand you have to do what you have to do, hopefully.