In this paper the authors study time dependent Lyapunov functions for nonautonomous systems described by differential inclusions. In particular it is shown that Lyapunov functions are viscosity supersolutions of a Hamilton-Jacobi equation. For this aim a new viability theorem for differential inclusions with time dependent state constraints is proved. The viability conditions are formulated both using contingent cones and in a dual way, using subnormal cones (negative polar of contingent cone)