I am a 44 year old male. I have had a green stool for the lasttwo days. Could it have been because of something I ate?

There. There are some food items that can cause green stool. Black licorice, for instance, can do so. However, as indicated by the other folks who've answered, this is probably going to be a self-limited thing that requires no treatment. If it persists or you develop pain, fevers, or other symptoms, see your doctor.
The. The green is simply the bile your body produces. It is not abnormal.
It. It may also represent a gastroenteritis. It is usually self-limited. Stay hydrated and if it doesn't clear over the next few days, you should see your physician.