Python Tutorial - 21 : Python datetime

preview_player
Показать описание
from datetime import datetime
from datetime import date

print(currentDate)

testDate = date(2023, 3, 1)
print(testDate)

print("Today's date", today)

# The method to control the format of datetime is strftime()
print("Formatted date is ", formattedDate)

customDateTime = datetime(year=2023, month=1, day=1, hour=00, minute=00, second=00)
print("1st Jan 2023 datetime format ", customDateTime)

timeDifference = currentDate - customDateTime
print("Time difference is ", timeDifference)

#python #datetime #pythondatetime
Рекомендации по теме
welcome to shbcf.ru