Primary
date.replace() ⚬|Documentation|1st|20251021143530-00-⌔
datetime — Basic date and time types — Python 3 documentation#datetime.date.replace
date.replace(year=self.year, month=self.month, day=self.day)Return a new
dateobject with the same values, but with specified parameters updated.Example:
>>> import datetime as dt >>> d = dt.date(2002, 12, 31) >>> d.replace(day=26) datetime.date(2002, 12, 26)The generic function
copy.replace()also supportsdateobjects.Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •