from datetime import datetime def myfun(): time_now = datetime.now().strftime('%H:%M:%S') print(f'The time now is {time_now}') if __name__=="__main__": myfun()
The time now is 10:15:50
from datetime import date def myfun(): today_date = date.today() print(today_date) if __name__=="__main__": myfun()
2024-06-06