If at all possible, shop early in the morning at the grocery. There will be more mark downs on produce, meats and dairy from which to choose.
When shopping at a farmers market, the early folks will get the most variety, and the late afternoon shoppers might be able to get some deals from farmers. Most farmers do not want to carry the produce back home with them, and if they do not have another place they sell, they might be willing to mark their goods down a bit. Just remember that those farmers put their hard work, time, and energy into growing that food--be respectful and don't be "cheap". Instead of "how much are you willing to mark this down", ask "if I were to buy all of these pumpkins, would you be able to reduce the price a little bit?"
Even though I'm up for a good deal whenever I can get it, I prefer to shop at farmers markets in the mornings. There is something so nostalgic about watching the farmers set up, the crispness in the air, and seeing all of the produce and wares laid out in their full glory. I'm a sucker for a good farmers market!