Add missing time import
Use absolute imports
Properly encode bytes for printing