Skip to content

Small typo in documentation substract method #925

Description

@qdesmedt
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

There is a small typo in the doc for the pendulum object's subtract method.

https://github.com/python-pendulum/pendulum/blob/master/docs/docs/addition_subtraction.md?plain=1#L67

>>> dt = dt.subtract(minutes=1)
'2012-01-28 01:01:00'
>>> dt = dt.subtract(minutes=24)
'2012-01-28 00:00:00'

The result of dt.subtract(minutes=24) is wrong, it should be 2012-01-28 00:37:00

Activity

  1. ABolouk commented on Dec 6, 2025

    @ABolouk

    Can I work on this?

  2. added a commit that references this issue on Mar 17, 2026
    4fa63dd
  3. frankgoldfish commented on Mar 17, 2026

    @frankgoldfish

    I've opened a PR to fix this: #949

    Three incorrect values were found:

    • add(hours=1) result showed '2012-02-25' instead of '2012-01-29'
    • subtract(hours=1) result showed '2012-02-29' instead of '2012-01-29' (also impossible date in context)
    • subtract(minutes=24) from 01:01:00 showed '00:00:00' instead of '00:37:00'
  4. added a commit that references this issue on Mar 30, 2026
    0a88aec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions