Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get weekday from date python

>>> import datetime
>>> datetime.datetime.today()
datetime.datetime(2012, 3, 23, 23, 24, 55, 173504)
>>> datetime.datetime.today().weekday()
4
Comment

python datetime weekday

from datetime import datetime
date_str='10-12-20'
datetime_object = datetime.strptime(date_str, '%m-%d-%y')
datetime_object.weekday()
Comment

how to get today weekday in python

today_day = date.today()
days = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","sunday"]
print("Today weekday is ",days[today_day.weekday()])
Comment

python datetime get weekday name

import datetime
now = datetime.datetime.now()
print(now.strftime("%A"))
Comment

get week from datetime python

import datetime as dt
dt.datetime.strptime('2019-01-01', '%Y-%m-%d').isocalendar()[1]
Comment

get weekday from date python

# int value range: 0-6, monday-sunday
weekday = datetime.weekday()
Comment

How to get the date from week number in Python?

import datetime
from dateutil.relativedelta import relativedelta
 
week = 25
year = 2021
date = datetime.date(year, 1, 1) + relativedelta(weeks=+week)
print(date)
Comment

PREVIOUS NEXT
Code Example
Python :: blender python add collection to scean collection 
Python :: python do something while waiting for input 
Python :: python __str__ vs __repr__ 
Python :: python try and except 
Python :: how to learn python 
Python :: how to change int to four decimal places in python 
Python :: substract list python 
Python :: python count same number in list 
Python :: user information in python 
Python :: Write a table to CSV file python 
Python :: delete occurrences of an element if it occurs more than n times python 
Python :: python extract substring 
Python :: change forms labels django 
Python :: python for loop with step 
Python :: add title to relplot seaborn 
Python :: pandas series plot horizontal bar 
Python :: sort and remove duplicates list python 
Python :: python tkinter label widget 
Python :: create button in pyqt 
Python :: socket always listen in thread python 
Python :: get source code selenium python 
Python :: python binary search 
Python :: numpy linspace of dates 
Python :: Invalid comparison between dtype=datetime64[ns] and date filter 
Python :: BURGERS2 solution 
Python :: assosciate keys as list to values in python 
Python :: python dictionary sort by value then alphabetically 
Python :: python save variable to file pickle 
Python :: hugingface ner 
Python :: pandas check if any of the values in one column exist in another 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =