Contents
Python datetime – Get Weekday Full Version
To get Weekday Full Version using Python datetime, call strftime()
with %A
passed as argument.
Example 1: Get Weekday Full Version of Current Date
In the following example, we will take the current date, and get the full version of the weekday.
#import datetime package
import datetime
#get current time
d = datetime.datetime.now()
#print date
print(d)
#get the weekday full version
print(d.strftime("%A"))
Run Output
2019-06-26 08:09:03.092652
Wednesday
Example 2: Get Weekday Full Version of a Specific Date
In the following example, we will take a date 2019-08-12 and get the full version of the weekday.
#import datetime package
import datetime
#set a date
d = datetime.datetime(2019, 8, 12)
#print date
print(d)
#get the weekday full version
print(d.strftime("%A"))
Run Output
2019-08-12 00:00:00
Monday
Summary
In this tutorial, we extracted the full version of weekday from date using datatime package.
Related Tutorials
- How to get Weekday as Number using Python datetime?
- How to get Month as Number using Python datetime?
- Python Datetime to String
- How to get Weekday Short Version using Python datetime?
- How to get Day of Month using Python datetime?
- How to get Month Name Short Version using Python datetime?
- Python String to Datetime
- How to get Month Name Full Version using Python datetime?
- Python Compare DateTime