Step 1: Recall the nature of an LC circuit.
When a charged capacitor is connected to an inductor, the system performs electromagnetic oscillations with angular frequency:
\[
\omega = \frac{1}{\sqrt{LC}}
\]
Step 2: Write expressions for energies.
Electric energy stored in the capacitor at time \(t\):
\[
U_E = \frac{q^2}{2C}
\]
Magnetic energy stored in the inductor:
\[
U_B = \frac{1}{2}Li^2
\]
Step 3: Express charge and current as functions of time.
For an LC circuit:
\[
q = q_0 \cos(\omega t)
\]
\[
i = -q_0\omega \sin(\omega t)
\]
Step 4: Substitute into energy expressions.
Electric energy:
\[
U_E = \frac{q_0^2}{2C}\cos^2(\omega t)
\]
Magnetic energy:
\[
U_B = \frac{1}{2}L(q_0^2\omega^2)\sin^2(\omega t)
\]
Since \(\omega^2 = \frac{1}{LC}\),
\[
U_B = \frac{q_0^2}{2C}\sin^2(\omega t)
\]
Step 5: Condition for equal energies.
\[
U_E = U_B
\]
\[
\cos^2(\omega t) = \sin^2(\omega t)
\]
\[
\tan^2(\omega t) = 1
\Rightarrow \omega t = \frac{\pi}{4}
\]
Step 6: Find the required time.
\[
t = \frac{\pi}{4\omega}
= \frac{\pi}{4}\sqrt{LC}
\]
Hence, the correct answer is \(\boxed{\dfrac{\pi}{4}\sqrt{LC}}\).