Although you do not state where you are from, from your description I suspect you are from a cold winter location. A water heater must bring the temperature of the water from ground temperature to a desired temperature. In the winter, the ground temperature within the top few feet drops. In effect, the city water system stores colder water in the winter, making your water heater devote more of its heat to raising the colder water to the summertime average before it raises the water to your desired temperature. The heating ability of the gas heater seems to ‘lose’ 25% of its heating ability. Nothing can be done about raising the winter-time temperature of the water.
Unfortunately, starting with 30 gallons of hot water in the water heater, you run out of shower water in about 20 minutes, then the water must heat up without water running for another 1/2 hour. The only way to avoid the problem is to add another water heater or another source for hot water with a larger heat input, such as a boiler and external water heating tank.