Finding next month: Excel, Python

jamescooper

Well-known Member
Joined
Sep 8, 2014
Messages
890
Hello the following returns "Feb 25"

today = datetime.datetime.today().date()
string_date = today.strftime("%b %y")

I now want to adapt so that it finds the next month from today, "Mar 25".

Any ideas, thanks.
 
Rich (BB code):
yourdate+relativedelta(months=1)

1740475320577.png

1740475395416.png
 
Upvote 0
Sorry forgot that you would need the dateutil module installed to use the above, I don't think there is an easy/accurate solution using standard Python
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top