Device-to-device communication and energy harvesting are both key technologies to improve spectrum and energy efficiency. In this paper, we investigate the resource allocation problem for the energy harvesting-powered D2D communication underlaying cellular networks, where D2D pairs firstly harvest energy and then transmit information signals. The goal is to maximize the sum throughput via joint time scheduling and power control while satisfying the SINR requirement of cellular user and taking into account the energy constraint. The formulated non-convex problem is transformed into a nonlinear fractional programming problem with a tactful reformulation. Coupled with D.C. (difference of two convex functions) programming, a near optimal solution of the non-convex problem can be obtained by iteratively solving a sequence of convex problems. Then, a first-order algorithm is employed to solve these convex problems. Numerical simulations are conducted to validate the effectiveness of the proposed algorithm and evaluate the system throughput performance.