Search code examples
pythonpendulum

latest version of pendulum.Interval()?


I'm working with some code from a year or two ago and it has:

import pendulum
pendulum.Interval(minutes=1000)

This worked with pendulum version 1.5.0, but doesn't work with the latest version 2.0.5. Is there an equivalent of pendulum.Interval in the latest version?


Solution

  • The code used Interval to loop through a time range. It looks like the latest version should be:

    dt = pendulum.now()
    dt.add(minutes=1000)