Is Hamilton-Jacobi equation valid for only conserved systems?

From derivation of Hamilton-Jacobi (HJ) equation one can see that it is only applicable for conserved systems, but from some books and Wikipedia one reads the HJ equation as

$$\frac{\partial{S}}{\partial{t}}+H(q,\frac{\partial{S}}{\partial{q}},t)~=~0$$

there is an extra variable $t$ in Hamilton's function. When Hamilton's function explicitly depends on time , this means that energy is not conserved. So where is truth?

-

1. The Hamilton-Jacobi equation is a partial differential equation for a function $S(q,t)$. Given a Hamiltonian $H(q, p ,t)$. Even if $H$ explicitly depends on time, there is nothing preventing one from writing down and attempting to solve the Hamilton Jacobi equation given such a Hamiltonian. This leads into the second point.