Optimal strategies for a time-dependent harvesting problem