The general derivation of Hamilton’s equations involve the change in the Hamiltonian and consequently the change in the Lagrangian that is a function of $q$ and $\dot q$, $L(q,\dot q)$. This is shown in this simple video https://www.youtube.com/watch?v=jXu6zIItnLM
When deriving Hamilton’s equations for $\dot q$ and $\dot p$, the Lagrangian is only a function of $q$ and $\dot q$ but not time. Therefore the Lagrangian used to derive Hamilton’s equations is time-independent as it appears. Does that means that Hamilton’s equations for $\dot q$ and $\dot p$ are only right for systems for which the Lagrangian is time-independent (and therefore the Hamiltonian - or energy is conserved)?