Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

extract name of day from datetime python

# Example of a datetime variable
mondayVariable = dt.datetime(2022,2,28)
# Extracting the number of the day in the week 
# monday corresponding to 0
# tuesday -> 1
# sunday -> 6
monday.weekday()

#######
# Or if you want monday as output 
monday.strftime('%A')
 
PREVIOUS NEXT
Tagged: #extract #day #datetime #python
ADD COMMENT
Topic
Name
7+9 =