The first one is fine.
The second one doesn't work. BY THE TIME somehow only works with a positive, or a request to do something (not a request NOT to do something).
Finish your homeword by the time I get back.
If you don't finish your homework by the time I get back, you can't watch TV.
BUT:
Don't eat dinner by the time I get back. doesn't really make sense.