import dateparser
print(dateparser.parse("1 week"))
print(dateparser.parse("1 month"))
print(dateparser.parse("6 months"))
print(dateparser.parse("1 year"))
The above code lines return the below output:
2022-01-27 11:30:50.229535
2022-01-03 11:30:50.231393
2021-08-03 11:30:50.232393
2021-02-03 11:30:50.232938
Essentially they consider the current timestamp and return prev one week or prev one moth or prev 6 months or prev one year date time. What if I want date parser to consider a custom timestamp and based on that return the prev one week or prev one moth or prev 6 months or prev one year date time?? For Example: For the same above code, I want the below output because I want date parser to consider the start date as 2021-06-13 11:30:50.229535
2022-06-06 11:30:50.229535
2022-05-14 11:30:50.231393
2021-01-13 11:30:50.232393
2020-06-13 11:30:50.232938
how to go about configuring this start date?