I'm not sure how you're supposed to calculate the time constant of a
capacitor when a direct current is applied.
The time constant for the capacitor is simply RC and it applies to both AC and DC circuits, but only under transient conditions such as during a period of time just after a switch connects or disconnects a capacitor to the circuit. After a long time (steady state conditions), the RC time constant is not involved in either an AC or DC circuit.
DC means that frequency equals = 0, the resistance is infinite, but
you need a value for the resistance to use the formula tau = RC.
The $R$ in the time constant is not the resistance of the capacitor, but the resistance of a resistor connected to the capacitor. While it is true that the impedance (the term impedance applies here, not resistance) of an ideal capacitor is infinite at zero frequency, during transient conditions currents an voltages are changing so the impedance of the capacitor is not infinite under transient conditions. The applicable general equations for voltage and current in an ideal capacitor when voltages and currents are changing are
$$i(t)=C\frac{dv(t)}{dt}$$
$$v(t)=\frac{1}{C}\int i(t)dt$$
Below is a series RC DC circuit. At time $t=0$ the switch is closed. The currents and voltages in the circuit as a function of time assuming the initial voltage across the capacitor before the switch is closed is zero are
$$v_{C}(t)=V(1-e\large^{-\frac{t}{RC}})$$
$$i(t)=\frac{V}{R} {e\large^{-\frac{t}{RC}}}$$
$$v_{r}(t)=i(t)R=V{e\large^{-\frac{t}{RC}}}$$
Note that the time constant is RC.
When $t=0$ the voltage across the capacitor is zero, the current in the circuit is the maximum of $V/R$ .
When $t=∞$. The current is zero and the voltage across the capacitor is the battery voltage $V$.
Hope this helps.
