How to get the list of all attributes and methods of datetime in Python

1 Answer

0 votes
import datetime

print(dir(datetime))
  
  
  
  
  
'''
run:
  
['MAXYEAR', 'MINYEAR', '__builtins__', '__cached__', '__doc__', '__file__', 
'__loader__', '__name__', '__package__', '__spec__', 'date', 'datetime', 
'datetime_CAPI', 'sys', 'time', 'timedelta', 'timezone', 'tzinfo']
  
'''

 



answered Apr 22, 2021 by avibootz
...