Although you can take magnesium supplements at any time of the day, it's preferable to take them after any meal.