# Chapter11.py ''' datetime Module is a Python Standard Module import datetime 5 primary class types datetime.date -> (year, month, day) HH:00:00.000000 datetime.time -> (hour, minute, second, micro(6)) datetime.datetime -> (yr,mon,day,hr,min,sec.micro) datetime.timedelta -> differences and arithmetic ops on dt classes datetime.tzinfo -> utc time zone formatting codes -> page 307,309 ''' # Current Date or Date/Time # today()-> date now()->date/time import datetime # Invoice Date invoiceDate = datetime.date.today() print(f"Invoice Date UnFormatted: {invoiceDate}") print(f"Invoice Date Formatted: {invoiceDate: %A %B %d, %Y}") # Due Date based on Net 30 terms terms = 30 dueDate = invoiceDate + datetime.timedelta(days=terms) print(f"Due Date: {dueDate: %x }") # type inputs -> datetime class # type input INT -> datetime class varMonth = int(input('Enter Month: ')) # 1-12 varDay = int(input('Enter Day: ')) varYear = int(input('Enter Year: ')) birthdate = datetime.datetime(varYear, varMonth, varDay) print(birthdate)