Learn Before
Concept icon
Concept

Using relativedelta

The relativedelta type can be applied to an existing datetime and can replace secific components of that datetime. There are two ways to build a relativedelta instance:

first, passing it two datetime classes

relativedelta(datetime1, datetime2)

second, passing it any number of the following keyword arguments

relativedelta(arg1=x, arg2=y, ...)

The order of attributtes considered when this relative data is added to a datetime is: Year Month Day Hours Minutes Seconds Microseconds

0

1

Concept icon
Updated 2021-07-13

Tags

Python Programming Language

Data Science

Related
Learn After