  We calculate the quarkonium formation time in relativistic heavy-ion
collisions from the space-time correlator of heavy quark vector currents in a
hydrodynamics background with the initial nonequilibrium stage expanding only
in the longitudinal direction. Using in-medium quarkonia properties determined
with the heavy quark potential taken to be the free energy from lattice
calculations and the fact that quarkonia can only be formed below their
dissociation temperatures due to color screening, we find that $\Upsilon$(1S),
$\Upsilon$(2S), $\Upsilon$(3S), $J/\psi$ and $\psi^\prime$ are formed,
respectively, at 1.2, 6.6, 8.8, 5.8, and 11.0 fm/c after the quark pair are
produced in central Au+Au collisions at the top energy of Relativistic Heavy
Ion Collider (RHIC), and these times become shorter in semi-central collisions.
We further show, as an example, that including the effect of formation time
enhances appreciably the survivability of $\Upsilon$(1S) in the produced hot
dense matter.
