Information-centric networking (ICN) and software defined networking (SDN) has been perceived as a promising paradigm for integrating distributed generation (DG) into smart grid networks for flexibility and dynamic features. However, flexible, controllable and reliable time synchronization still remains an open issue for supervisory control and data sensing in smart grid. Firstly, for information-centric smart grid, smart grid entities may obtain available data from caching routers, and data delivery between caching routers with edge devices results in time synchronization requirements of on-path caching routers. Without on-path time synchronization of caching routers, it may lead to maliciously fluctuations if energy data for monitoring the energy supplying and consumption are collected and traversed at an inappropriate time. Secondly, as scale expanding and network environment of smart grid becomes complex and changeable, on-path time synchronization needs a unified and dynamic management and control. To address these issues, in this paper we propose a novel scheme of software- defined on-path time synchronization (SD-OPTS) scheme for information-centric smart grid. In proposed scheme, all on-path caching routers share the time stamps from master clock and synchronize the time of local clock during one-time synchronization process. Besides, SDN controller estimates on-path caching routers' sync error, before choosing the nearest nodes to implement accurate time synchronization. The simulation results demonstrate the efficiency of software-defined on-path time synchronization scheme. The SD-OPTS scheme supports the flexibility, controllability and reliability of time synchronization.