I got mine right before applying, and from professors whom i had not seen in years. It worked out, but I think it would be a better idea if you got them sometime after the semester is over. That way theyll remember you better and that may make the letter more personal. Just have them submit the letter to interfolio and have them ready by the time you are ready to apply. Also, something to keep in mind, the letters kept me from being completely done by about a month, so you really want to have them ready to go to avoid delaying your app.