I am studying for a Python certified technician. As for how the code actually helps, I want to try the code only on the side of the user.
import datetime
now = datetime.datetime.now()
print(now)
print(now.isoformat())
print(now.strftime('%d/%m/%y-%H%M%S%f'))
today = datetime.date.today()
print(today.isoformat('%d/%m/%y'))
t = datetime.time(hour=1, minute=0,second=5,microsecond=100)
print(t)
print(t.isoformat())
print(t.strftime('%H%_M_%S_%f'))
print(now)
d = datetime.timedelete(weeks=1)
#d = datetime.timedelete(days=1)
#d = datetime.timedelete(hours=1)
#d = datetime.timedelete(minutes=1)
#d = datetime.timedelete(second=1)
#d = datetime.timedelete(microsecond=1) //Select one argument
print(now-d)
import time
#pair print('###')
#time.sleep(10)
#pair print('###')
import os
import shutil
file_name = 'test.txt'
if os.path.exists(file_name):
shutil.copy(file_name, "{}.{}".format(
file_name, now.strftime('%Y_%m_%d_%H__%M_%S')))
with open(file_name, 'w') as f:
f.write('test')
Code with the error
print(now)
d = datetime.timedelete(weeks=1)
print(now-d)
Also, put the code to generate the text.