RC Circuit Analysis Direction Changes Formula
The basic constitutive equation for a capacitor is based on these assumed polarities,

The equation being,
$$i(t)=C\frac{dv}{dt}$$
If you want to define your current as leaving the capacitor then you need to include a negative sign in your dv/dt term.