Why Do Bats Fly at Night?

Since bats have wings and can fly like birds, why then do they fly only at night? 

The bat who thought it was the luckiest animal because it was the only mammal who could fly. But, when a war broke out between the flying and land animals, the bat couldn’t choose a side. It kept switching back and forth. So how did the sly bat end up only flying at night?