why only hot water for a short time

Why am I only getting hot water for a short time?

Question: Why am I running out of hot water after a few minutes?

Answer: If you've already replaced the heating element, it's probably your dip tube. The problem is your dip tube has come loose and the cold water being pumped into the tank is sitting on top of the heated water, so you only get hot water for a couple minutes before you're getting cold water again.