Probably best no sooner than two days before. You don't want to create any systemic fluid/electrolyte imbalances that may be present the day of surgery.
Mag Citrate is an effective laxative to clean out your bowels. I would suggest taking it 2 days before surgery to clean out the large bowel and then eat a high fiber diet until your surgery. You may monitor your bowels postoperatively, use a stool softener postop and if no movement within the first 2-3 days after surgery, use another laxative. The citrate of magnesia might be a bit much postoperatively unless you are around 5 days post op with continued difficulties moving your bowels.Good luck with your surgery.Dr T