sdispater / pendulum

Python datetimes made easy
https://pendulum.eustace.io
MIT License
6.12k stars 372 forks source link

in_words() exclude week #816

Open liweibenz opened 3 months ago

liweibenz commented 3 months ago

hello,Hope to add the exclude week field in the in_words method

import pendulum dt1 = pendulum.datetime(1988, 2, 10, 22, 33, 55) dt2 = pendulum.datetime(2024, 2, 25, 5, 55, 10) dt3 = dt2 - dt1 print(dt3.in_words()) 36 years 2 weeks 7 hours 21 minutes 15 seconds

Can return year, month, day, excluding weeks

Expected return result:

36 years 14days 7 hours 21 minutes 15 seconds