Consider the definition for a canonical transformation $(q,p) \to (Q,P)$ as one which satisfies: $$P ·dQ − Kdt = p·dq − Hdt + dS.$$
My professor stated that there are two simple ways of testing whether a mapping $(q,p)$ to $(Q,P)$ is canonical:
The first is by examining
$$P · dQ − p · dq$$
and if it equals to $dA$ (a differential) then it is a canonical transformation.
The second is to check if $$\sum_{k=1}^n dq^k\wedge dp_k = \sum_{k=1}^n dQ^k\wedge dP_k\tag{1}$$ and if it satisfies the equality, then it is a canonical transformation.
I am wondering is he correct in general? To me, these tests appear to be sufficient and necessary conditions only when the canonical transformation is independent of time (so that the hamiltonian before and after the transformation stays constant, i.e. $K=H$).