Skip to content
Advertisement

Python function that returns first day and last day from x months ago

The following python code returns the first/last day of prev month but I want to be able to return the first day from 3 months ago instead

JavaScript

CURRENT OUTPUT

JavaScript

Advertisement

Answer

You could convert months to weeks:

JavaScript

Out:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement