Dipole-dipole interaction between two two-level `atoms in photonic crystal nanocavity is investigated based on finite-difference time domain algorithm. This method includes both real and virtual photon effects and can be applied for dipoles with different transition frequencies in both weak and strong coupling regimes. Numerical validations have been made for dipoles in vacuum and in an ideal planar microcavity. For dipoles located in photonic crystal nanocavity, it is found that the cooperative decay parameters and the dipole-dipole interaction potential strongly depend on the following four factors: the atomic position, the atomic transition frequency, the resonance frequency, and the cavity quality factor. Properly arranging the positions of the two atoms, we can acquire equal value of the cooperative decay parameters and the local coupling strength. Large cooperative decay parameters can be achieved when transition frequency is equal to the resonance frequency. For transition frequency varying in a domain of the cavity linewidth around the resonance frequency, dipole-dipole interaction potential changes continuously from attractive to repulsive case. Larger value and sharper change of cooperative parameters and dipole-dipole interaction can be obtained for higher quality factor. Our results provide some manipulative approaches for dipole-dipole interaction with potential application in various fields such as quantum computation and quantum information processing based on solid state nanocavity and quantum dot system.