Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python Day of the week

>>> from datetime import datetime
>>> datetime.today().strftime('%A')
'Wednesday'
Comment

get week from datetime python

import datetime as dt
dt.datetime.strptime('2019-01-01', '%Y-%m-%d').isocalendar()[1]
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 :: torchvision.transforms 
Python :: python requests port 
Python :: python apply function to dictionary values 
Python :: Issue Pandas TypeError: no numeric data to plot 
Python :: python float precision 
Python :: how to print to a file in python 
Python :: bar labeling in matplotlib 
Python :: Write a python program to find the most frequent word in text file 
Python :: python folder exists 
Python :: how to disable resizing in tkinter 
Python :: python remove new line 
Python :: completely uninstall python and all vritualenvs from mac 
Python :: pandas iloc select certain columns 
Python :: dictionary python length 
Python :: get month name from datetime pandas 
Python :: python remove background 
Python :: pytest check exception 
Python :: how to save a neural network pytorch 
Python :: convert string to utf8 python 
Python :: linear congruential generator in python 
Python :: how to add three conditions in np.where in pandas dataframe 
Python :: getting the file path of a file object in python 
Python :: python - remove duplicate items from the list 
Python :: django on_delete options 
Python :: isprime python 
Python :: python remove last element from list 
Python :: pass variable in subprocess run python 
Python :: how to open xml file element tree 
Python :: boto3 paginate 
Python :: df count zeros 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =