Running a desk fan off a car battery: How long will it last?
@PDuarte's answer is not quite correct. However, let's try another tack.

Your 30 watt fan will draw about 2.5 amps at 12 volts (2.5 times 12 is 30). Assuming 90% efficiency from the inverter means that the inverter will draw 2.5/.9, or 2.78 amps. A 50 Ahr battery will last 50/2.78 or 18 hours. 

Why is PDuarte's answer different? Because a battery does not lose voltage linearly with time. Here is a site which addresses the issue. A "typical" lead-acid battery will have a discharge curve which looks more or less like  for a 20 Ahr unit. Since you are talking about a 50 Ahr battery, the 0.6 A curve is closer to correct. Note that the battery voltage will remain above 11 volts pretty much to the end.

However, you need to be aware that, as the site says,


  Don't expect battery to give you 100% of capacity and even don't try to be close to that.




Granted, 8 hours times 2.78 gives 22.2 hours, which is less than a 50% discharge for your 50 Ahr battery, so you're unlikely to experience problems, but it's something to keep in mind in any future endeavors

There are such things as "deep discharge" lead-acids available which will tolerate heavy use, but they are expensive, and car batteries are not made to that standard.