การทำงานกับวันที่และเวลาใน Python
Max Shron
Data Scientist and Author

two_hurricanes = ["10/7/2016", "6/21/2017"]
จะทำสิ่งต่อไปนี้ได้อย่างไร
# Import date from datetime import date# Create dates two_hurricanes_dates = [date(2016, 10, 7), date(2017, 6, 21)]
# Import date from datetime import date # Create dates two_hurricanes_dates = [date(2016, 10, 7), date(2017, 6, 21)]print(two_hurricanes_dates[0].year) print(two_hurricanes_dates[0].month) print(two_hurricanes_dates[0].day)
2016
10
7
print(two_hurricanes_dates[0].weekday())
4
การทำงานกับวันที่และเวลาใน Python