Adding days to any date and even February and leap year too if any.
Here is the date i have : 2020-07-08T07:03:08Z
I need to add days to the above date with some if else conditions.
if(month):
# i need to increment 30/31 days as per the month have
next_upcoming_date = 2020-08-07T07:03:08Z
if(year):
# i need to increment 365/366(when leap year) as per the year
next_upcoming_date = 2021-07-07T07:03:08Z
Example: if 31st If the subscription terms are $25.99 USD a month and the subscriber signs up on Thursday, July 31. The subscriber is billed as follows:
Thursday, July 31 = $25.99 USD
Saturday, August 31 = $25.99 USD
Wednesday, October 1= $25.99 USD
Saturday, November 1= $25.99 USD
and so on
Example: if 30th If the subscription terms are $25.99 USD a month and the subscriber signs up on Tuesday, December 30, the subscriber is billed as follows:
Tuesday, December 30 = $25.99 USD
Friday, January 30 = $25.99 USD
Sunday, March 1= $25.99 USD
Wednesday, April 1= $25.99USD
and so on
please Suggest me how can i achieve this.