Get Time String In Python Function