“Python hari kerja” Kode Jawaban

Dapatkan hari kerja dari tanggal Python

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

Python hari kerja

df['date_time'].dt.dayofweek #gives only the index(0-monday,6-sunday)
df['date_time'].dt.weekday_name #gives the day
Lazy long python

bagaimana mendapatkan hari kerja hari ini di Python

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

Python Datetime Weekday

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

Dapatkan Python hari kerja hari ini

from datetime import datetime

#int value ranging from 0-6, for example: monday = 0 & friday = 4
print(datetime.today().weekday())
Jolly Jellyfish

Dapatkan hari kerja dari tanggal Python

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

Jawaban yang mirip dengan “Python hari kerja”

Pertanyaan yang mirip dengan “Python hari kerja”

Lebih banyak jawaban terkait untuk “Python hari kerja” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya