# Order.py # datetime class page 67 # orderDate # dueDate # Timestamp log file ''' Datetime Module datetime.datetime.year() module.class.function 4 common classes for datetime datetime -> both date and time 2025-01-08 01:48:25.123456 date -> date with a zero time 2025-01-08 12:00:00.000000 time -> 04:48:25... timedelta -> calculate date and time ranges ''' import datetime # from datetime import datetime def orderInfo(): # Order's datetime stamp orderTimeStamp = datetime.datetime.now() print(orderTimeStamp) # print using datetime class format # use timedelta to calculate the due date dueDate = orderTimeStamp + datetime.timedelta(days=30) print(dueDate) # strftime -> format: will take a datetime class and format as string # strptime -> parse: will parse integars and convert to datetime class ## we ask a user for their birthday int(m),int(d), int(y) -> datetime # Friendly formatted date using strftime() fmt_dates = "%A %m/%d/%Y" str_dueDate = dueDate.strftime(fmt_dates) # 2/7/2025 print(str_dueDate) return orderTimeStamp.strftime(fmt_dates) def orderDetails(): pass # EOF