datetime — Basic date and time types — Python 3. 14. 0 documentation A date object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions January 1 of year 1 is called day number 1, January 2 of year 1 is called day number 2, and so on
unittest. mock — getting started — Python 3. 14. 0 documentation When date today() is called a known date is returned, but calls to the date( ) constructor still return normal dates Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern
What’s New In Python 3. 8 — Python 3. 15. 0a1 documentation Added new alternate constructors datetime date fromisocalendar() and datetime datetime fromisocalendar(), which construct date and datetime objects respectively from ISO year, week number, and weekday; these are the inverse of each class’s isocalendar method
Enum HOWTO — Python 3. 11. 14 documentation For example, datetime date has two methods for returning the weekday: weekday() and isoweekday() The difference is that one of them counts from 0-6 and the other from 1-7
Whats New In Python 3. 11 — Python 3. 13. 9 ドキュメント datetime date fromisoformat(), datetime time fromisoformat() and datetime datetime fromisoformat() can now be used to parse most ISO 8601 formats (barring only those that support fractional hours and minutes)