Created
February 7, 2021 23:41
-
-
Save alphazwest/f4f11f98914aecfb9bb0fb334382afbe to your computer and use it in GitHub Desktop.
Getting a weekday integer representation using the datetime class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
# Create datetime object | |
date = datetime.now() | |
>>> 2021-02-07 15:30:46.665318 | |
# Get the weekday value, as an integer | |
date.weekday() | |
>>> 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment