MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / subtract

Method subtract

src/pendulum/time.py:112–140  ·  view source on GitHub ↗

Add duration to the instance. :param hours: The number of hours :type hours: int :param minutes: The number of minutes :type minutes: int :param seconds: The number of seconds :type seconds: int :param microseconds: The number of m

(
        self, hours: int = 0, minutes: int = 0, seconds: int = 0, microseconds: int = 0
    )

Source from the content-addressed store, hash-verified

110 )
111
112 def subtract(
113 self, hours: int = 0, minutes: int = 0, seconds: int = 0, microseconds: int = 0
114 ) -> Time:
115 """
116 Add duration to the instance.
117
118 :param hours: The number of hours
119 :type hours: int
120
121 :param minutes: The number of minutes
122 :type minutes: int
123
124 :param seconds: The number of seconds
125 :type seconds: int
126
127 :param microseconds: The number of microseconds
128 :type microseconds: int
129
130 :rtype: Time
131 """
132 from pendulum.datetime import DateTime
133
134 return (
135 DateTime.EPOCH.at(self.hour, self.minute, self.second, self.microsecond)
136 .subtract(
137 hours=hours, minutes=minutes, seconds=seconds, microseconds=microseconds
138 )
139 .time()
140 )
141
142 def add_timedelta(self, delta: datetime.timedelta) -> Time:
143 """

Calls 2

timeMethod · 0.80
atMethod · 0.80