I just nipped my 2 year old daughter's first and only attempt at biting (she turned my 3 year old's knuckle black chomping his finger) the same way I nipped her first and only attempt at hitting 6 months ago and her older two siblings first and only attempts at hitting when they were 18 months old. (they can still hit each other in play, but never maliciously, and never other kids). Our kids can develop motor skills and throwing impulses 23.99 hours a day, but they can never hit other kids, and they CAN totally understand it at this age.
Calmly make eye contact, say, "no hitting" and give her a good sting on the butt. Then make her apologize. Then move on positively and happily with the rest of the day, no grudges. Repeat as necessary (probably won't need repeating). People who don't agree with "hitting for hitting" will say it's confusing and ironic and all that, but it's not. Those people just don't like the idea and haven't done it. It is super fast. Kids this age only know the results to themselves from their own actions, they dont' have empathy yet, and an unpleasant physical result is not confusing.
They ARE confused by time outs. How is that relevant to hitting? Not to say it may not work with lots of repetition in some kids when they get older, but who wants their kid hitting that long? If you don't swat your kid, another kid probably will (only with a punch in the face instead of a controlled swat on the butt). Kids ARE confused by words and feelings and explanations of it "not being nice" at that age. Demonstrating nice touching is not a deterrent from future attempts. Now if any of these methods work right away, great, but keep the swat on the back burner just in case she continues the behavior.
Aggression to other kids is serious and can be nipped quickly at 18months (gets harder by the month though, and watch out if you wait until 2 to start). My non spanking friend's kids all hit and bit much longer. I've never had to hover or worry in playgroups, my kids know it's not OK. They hug, wrestle, do "nice touching" all day long, but never hit, kick, bite, push, etc. It has to start at home (that's when siblings come in handy), since you can't do this in public. No worries, soon enough, she will hit you, so you can teach her then.
The next time she tries to hit, and stops at a warning (which she will once she knows the consequence), give her tons of praise and celebration for rethinking it.