pip install pydate-fns
from datetime import datetime
from pydate import is_weekday,
if is_weekday(datetime.now()):
print("It's a weekday")
else:
print("It's the weekend 😎")
date-fns methods parity
- add
- addBusinessDays
- addDays
- addHours
- addISOWeekYears
- addMilliseconds
- addMinutes
- addMonths
- addQuarters
- addSeconds
- addWeeks
- addYears
- areIntervalsOverlapping
- clamp
- closestIndexTo
- closestTo
- compareAsc
- compareDesc
- constants
- constructFrom
- daysToWeeks
- differenceInBusinessDays
- differenceInCalendarDays
- differenceInCalendarISOWeekYears
- differenceInCalendarISOWeeks
- differenceInCalendarMonths
- differenceInCalendarQuarters
- differenceInCalendarWeeks
- differenceInCalendarYears
- differenceInDays
- differenceInHours
- differenceInISOWeekYears
- differenceInMilliseconds
- differenceInMinutes
- differenceInMonths
- differenceInQuarters
- differenceInSeconds
- differenceInWeeks
- differenceInYears
- eachDayOfInterval
- eachHourOfInterval
- eachMinuteOfInterval
- eachMonthOfInterval
- eachQuarterOfInterval
- eachWeekOfInterval
- eachWeekendOfInterval
- eachWeekendOfMonth
- eachWeekendOfYear
- eachYearOfInterval
- endOfDay
- endOfDecade
- endOfHour
- endOfISOWeek
- endOfISOWeekYear
- endOfMinute
- endOfMonth
- endOfQuarter
- endOfSecond
- endOfToday
- endOfTomorrow
- endOfWeek
- endOfYear
- endOfYesterday
- format
- formatDistance
- formatDistanceStrict
- formatDistanceToNow
- formatDistanceToNowStrict
- formatDuration
- formatISO
- formatISO9075
- formatISODuration
- formatRFC3339
- formatRFC7231
- formatRelative
- fp
- fromUnixTime
- getDate
- getDay
- getDayOfYear
- getDaysInMonth
- getDaysInYear
- getDecade
- getDefaultOptions
- getHours
- getISODay
- getISOWeek
- getISOWeekYear
- getISOWeeksInYear
- getMilliseconds
- getMinutes
- getMonth
- getOverlappingDaysInIntervals
- getQuarter
- getSeconds
- getTime
- getUnixTime
- getWeek
- getWeekOfMonth
- getWeekYear
- getWeeksInMonth
- getYear
- hoursToMilliseconds
- hoursToMinutes
- hoursToSeconds
- intervalToDuration
- intlFormat
- intlFormatDistance
- isAfter
- isBefore
- isDate
- isEqual
- isExists
- isFirstDayOfMonth
- isFriday
- isFuture
- isLastDayOfMonth
- isLeapYear
- isMatch
- isMonday
- isPast
- isSameDay
- isSameHour
- isSameISOWeek
- isSameISOWeekYear
- isSameMinute
- isSameMonth
- isSameQuarter
- isSameSecond
- isSameWeek
- isSameYear
- isSaturday
- isSunday
- isThisHour
- isThisISOWeek
- isThisMinute
- isThisMonth
- isThisQuarter
- isThisSecond
- isThisWeek
- isThisYear
- isThursday
- isToday
- isTomorrow
- isTuesday
- isValid
- isWednesday
- isWeekend
- isWithinInterval
- isYesterday
- lastDayOfDecade
- lastDayOfISOWeek
- lastDayOfISOWeekYear
- lastDayOfMonth
- lastDayOfQuarter
- lastDayOfWeek
- lastDayOfYear
- lightFormat
- locale
- max
- milliseconds
- millisecondsToHours
- millisecondsToMinutes
- millisecondsToSeconds
- min
- minutesToHours
- minutesToMilliseconds
- minutesToSeconds
- monthsToQuarters
- monthsToYears
- nextDay
- nextFriday
- nextMonday
- nextSaturday
- nextSunday
- nextThursday
- nextTuesday
- nextWednesday
- parse
- parseISO
- parseJSON
- previousDay
- previousFriday
- previousMonday
- previousSaturday
- previousSunday
- previousThursday
- previousTuesday
- previousWednesday
- quartersToMonths
- quartersToYears
- roundToNearestMinutes
- secondsToHours
- secondsToMilliseconds
- secondsToMinutes
- set
- setDate
- setDay
- setDayOfYear
- setDefaultOptions
- setHours
- setISODay
- setISOWeek
- setISOWeekYear
- setMilliseconds
- setMinutes
- setMonth
- setQuarter
- setSeconds
- setWeek
- setWeekYear
- setYear
- startOfDay
- startOfDecade
- startOfHour
- startOfISOWeek
- startOfISOWeekYear
- startOfMinute
- startOfMonth
- startOfQuarter
- startOfSecond
- startOfToday
- startOfTomorrow
- startOfWeek
- startOfWeekYear
- startOfYear
- startOfYesterday
- sub
- subBusinessDays
- subDays
- subHours
- subISOWeekYears
- subMilliseconds
- subMinutes
- subMonths
- subQuarters
- subSeconds
- subWeeks
- subYears
- toDate
- transpose
- weeksToDays
- yearsToMonths
- yearsToQuarters