It also starts the clock for your boss and your company, kicking off the transition plan of training, hiring, and otherwise covering your impending departure. The bad examples here are all too vague. With the last one, you're aligning yourself with company policy, which is good, but it still doesn't tell the reader how much notice that actually is. Be as specific as possible on the time you have between now and your last day.
However, it could also be the reaction if your company is approaching or is currently in a busy season and needs the additional staff, or it's experiencing unusual circumstances, like a hiring freeze, which would prevent it from replacing you entirely.