Converting datetime into string in Python

preview_player
Показать описание
Let’s see how to convert a datetime into a string in Python.

This conversion can be done using the strftime() method from the datetime class.

You can also read about it if you prefer on:

Official Documentation:

📚 Buy my book Python Fundamentals

👍 Please leave a LIKE and SUBSCRIBE for more content! 👍

⭐️ Tags ⭐️
- Python

#️⃣ Hashtags #️⃣
#Python
Рекомендации по теме
Комментарии
Автор

it says it cant find datetime library. how to fix. Please this is for my exams. I did from datetime import datetime but that doesnt seem to work

luigi
Автор

How about if you ask the user to enter the date? something like this datee = int(input("Enter the date:") #this will be the like 01/22/21
#convert the int date to string
how would you do that ?

alexanderantonio