Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get current week python

import datetime
my_date = datetime.date.today() # if date is 01/01/2018
year, week_num, day_of_week = my_date.isocalendar()
print("Week #" + str(week_num) + " of year " + str(year))
Comment

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 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 ::  
::  
Python ::  
Python ::  
::  
Python :: python set day of date to 1 
::  
::  
:: effektivwert python 
::  
Python ::  
::  
:: sys.path.append python 
Python :: plot multiple axes matplotlib 
Python ::  
::  
Python ::  
:: python count array length 
Python :: Find the title of a page in python 
:: how to remove quotes from a string in python 
::  
:: def function in python 
:: Kill python background process 
::  
Python ::  
::  
::  
Python :: notion python api 
Python ::  
ADD CONTENT
Topic
Content
Source link
Name
6+3 =