import time import datetime DateTime = datetime.datetime.now() DT = DateTime.strftime('%y%m%d') print(DateTime)