Equilibrium and time-dependent Josephson current in one-dimensional superconducting junctions