Dear student ,
we can say that , moles of MgCl2 = (1000 * 1000 ) / 94 = moles of Mg2+ = 10638.2 moles
Now, Mg2+ + 2e- -------> Mg
To convert 1 mole Mg ions ------> 2 F charge is required ( or 2 mole electrons )
So, to convert 10638.2 moles of Mg ions ----> 2 F * 10638.2 charge is required
= 2 * 96500 * 10638.2 C
Now, use the formula Q= It to find the time :
Q : charge
I : current
t : time
2 * 96500 * 10638.2 = 500 * t
t = 4106345.2 sec or 1140 hrs ( approx)
Chemistry Consultant
askiitians