A global condition for periodic Duffing-like equations