“Python Datetime Weekday” 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

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

python datetime dapatkan nama hari kerja

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

Jawaban yang mirip dengan “Python Datetime Weekday”

Pertanyaan yang mirip dengan “Python Datetime Weekday”

Lebih banyak jawaban terkait untuk “Python Datetime Weekday” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya