The two suborders of bats, Megachiroptera (megabats) and Microchiroptera (microbats), use different sensory modalities for perceiving their environment. Megabats are crepuscular and rely on a well-developed eyes and visual pathway, whereas microbats occupy a nocturnal niche and use acoustic orientation or echolocation more than vision as the major means of perceiving their environment. In view of the differences associated with their sensory systems, we decided to investigate the function and evolution of color vision (opsin genes) in these two suborders of bats. The middle/long wavelength (M/L) and short wavelength (S) opsin genes were sequenced from two frugivorous species of megabats, Haplonycteris fischeri and Pteropus dasymallus formosus, and one insectivorous species of microbat, Myotis velifer. Contrary to the situation in primates, where many nocturnal species have lost the functional S opsin gene, both crepuscular and strictly nocturnal species of bats that we examined have functional M/L and S opsin genes. Surprisingly, the S opsin in these bats may be sensitive to UV light, which is relatively more abundant at dawn and at dusk. The M/L opsin in these bats appears to be the L type, which is sensitive to red and may be helpful for identifying fruits among leaves or for other purposes. Most interestingly, H. fischeri has a recent duplication of the M/L opsin gene, representing to date the only known case of opsin gene duplication in non-primate mammals. Some of these observations are unexpected and may provide insights into the effect of nocturnal life on the evolution of opsin genes in mammals and the evolution of the life history traits of bats in general.