Does "time" mean the same thing in these two sentences?

The judge leniently granted a sentence with no hard time.

He is not living at home because he is doing time.
the same meaning