Appropriate flowering time is a crucial adaptation impacting fitness in natural plant populations. Although the genetic basis of flowering variation has been extensively studied, its mechanisms in nonmodel organisms and its adaptive value in the field are still poorly understood. Here, we report new insights into the genetic basis of flowering time and its effect on fitness in Panicum hallii, a native perennial grass. Genetic mapping in populations derived from inland and coastal ecotypes identified flowering time quantitative trait loci (QTL) and many exhibited extensive QTL-by-environment interactions. Patterns of segregation within recombinant hybrids provide strong support for directional selection driving ecotypic divergence in flowering time. A major QTL on chromosome 5 (q-FT5) was detected in all experiments. Fine-mapping and expression studies identified a gene with orthology to a rice FLOWERING LOCUS T-like 9 (PhFTL9) as the candidate underlying q-FT5. We used a reciprocal transplant experiment to test for local adaptation and the specific impact of q-FT5 on performance. We did not observe local adaptation in terms of fitness tradeoffs when contrasting ecotypes in home versus away habitats. However, we observed that the coastal allele of q-FT5 conferred a fitness advantage only in its local habitat but not at the inland site. Sequence analyses identified an excess of low-frequency polymorphisms at the PhFTL9 promoter in the inland lineage, suggesting a role for either selection or population expansion on promoter evolution. Together, our findings demonstrate the genetic basis of flowering variation in a perennial grass and provide evidence for conditional neutrality underlying flowering time divergence.