How do I turn a python datetime into a string, with readable format date?

The datetime class has a method strftime. The Python docs documents the different formats it accepts:

  • Python 2: strftime() Behavior
  • Python 3: strftime() Behavior

For this specific example, it would look something like:

my_datetime.strftime("%B %d, %Y")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)