A question are you on your feet for extended periods?
It could be dehydration, but the most common cause of cramps is calcium deficiency. Calcium is necessary for muscle contraction and when there is a deficiency a "charley horse" takes place.
Try a glass of milk in the evening.
Sometimes it is potasium. In that case try a bananna.
Circulatory problems can also cause cramps. 1000 mg a day of an omega-3 fish oil supplement will help with the microcirculation. In addition long acting niacin will help.
The specific product to treat such cramps was quinine sulfate, which was sold for a hundred years without a prescription. Recently the FDA took it off the market, but there may be some health food stores that still have a supply.
The first and the foremost to have cramps in legs during the night is dehydration! Drink plenty of water during the day; you'll need atleast 4 liters (a gallon) and check for the following couple of days, mostly the cramps will disappear!
Parth Adhyaru