You may be able to save hundreds on your next flight by booking at just the right time, according to a new study. analyzed millions of trips taken last year and determined the best time to book a flight based on destination.

The best time to buy a domestic ticket was 54 days in advance. People who planned trips to Mexico scored the cheapest fare 89 days ahead of their departure. The best time to book a flight to the Caribbean was 101 days in advance and Europe was 151 days ahead of time. For trips to Asia, flights booked 129 days before take-off were cheapest, and fares to Africa were best 166 days in advance.

Jo Ling Kent was on “Shepard Smith Reporting” today to discuss the research. She explained that the best thing to do is book between a 29 and 104-day window. The worst time to book a trip is within 13 days of departure.

The best time to book domestic trips for Christmas and Thanksgiving was June 4.

DHS Warns of Possible Shoe-Bomb Threats on U.S.-Bound Flights

FCC Votes to Consider Allowing Cellphone Use in Flights