Compared to the classical first-order Grünwald–Letnikov formula at time $t_{k+1}\; (\text{or}\; t_{k})$, we firstly propose a second-order numerical approximate formula for discretizing the Riemann–Liouvile derivative at time $t_{k+\frac{1}{2}}$, which is very suitable for constructing the Crank–Nicolson scheme for the fractional differential equations with time fractional derivatives. The established formula has the following form RLD0,tαu(t)| t=tk+12=τ−α∑ℓ=0kϖℓ(α)u(tk−ℓτ)+O(τ2),k=0,1,…,α∈(0,1), where the coefficients $\varpi_{\ell}^{(\alpha)}$$(\ell=0,1,\ldots,k)$ can be determined via the following generating function G(z)=(3α+12α−2α+1αz+α+12αz2)α,|z|<1.
Next, applying the formula to the time fractional Cable equations with Riemann–Liouville derivative in one and two space dimensions. Then the high-order compact finite difference schemes are obtained. The solvability, stability and convergence with orders $\mathcal{O}(\tau^2+h^4)$ and $\mathcal{O}(\tau^2+h_x^4+h_y^4)$ are shown, where $\tau$ is the temporal stepsize and $h$, $h_x$, $h_y$ are the spatial stepsizes, respectively. Finally, numerical experiments are provided to support the theoretical analysis.