For opportunistic routing in independent duty-cycled wireless sensor networks (WSNs), a sender dynamically determines a relay candidate set depending on the real-time network conditions. Due to independent and varying duty cycle length, the sender may handle different waking-up orders of the potential forwarders when it tries to forward data packets at different time instants. Conventional opportunistic routing protocols overlook the time-varying property of the waking-up order of the candidate nodes. In this paper, we theoretically analyze how to obtain an optimal candidate set for each node in order to minimize the end-to-end latency. Then, considering the realistic scenarios, we propose an opportunistic routing which jointly considers global and localized optimizations. Based on the relatively stable topology and duty-cycle length information, an original candidate set is constructed. Then, by considering the real-time link and duty cycle information in the local context, a further optimization for the original candidate set can be achieved. Simulation results show that our proposed schemes can significantly improve the end-to-end latency compared with the benchmarks.