strftime()方法

  1. import datetime
  2.  
  3. x = datetime.datetime(2019, 10, 1)
  4.  
  5. print(x.strftime("%B"))