filmov
tv
42. Strftime Function in Python with Code || Date Time Module-II Programming Tutorial

Показать описание
The strftime() function is used to convert date and time objects to their string representation. It takes one or more input of formatted code and returns the string representation.
Code:
from datetime import datetime
print(now)
print("Year:",year)
print("Month:",month)
print("Day:",day)
print("Time:",time)
print("date and time:",date_time1)
timestamp=1668797322
print("Date time object",date_time)
print("Output 2:",d)
print("Output 3:",d)
print("Output 4",d)
Code:
from datetime import datetime
print(now)
print("Year:",year)
print("Month:",month)
print("Day:",day)
print("Time:",time)
print("date and time:",date_time1)
timestamp=1668797322
print("Date time object",date_time)
print("Output 2:",d)
print("Output 3:",d)
print("Output 4",d)