The datetime is a library in Python which is a collection of date and time. Inside datetime, we can access date and time in any format, but usually, the date is present in the format of "yy-mm-dd" and the time is present in the format of "HH:MM:SS’".
Here,
- yy means year
- mm means month
- dd means day
- HH means hours
- MM means minutes
- SS means seconds
While accessing the date and time from datetime, we always get date and time together, here we are going to learn how to convert Date Time to Date?
To work with pandas, we need to import pandas package first, below is the syntax:
import pandas as pd
Let us understand with the help of an example:
Output:

need an explanation for this answer? contact us directly to get an explanation for this answer