Skip to content
Advertisement

A more suitable way to rewrite this?

I have the method:

JavaScript

This just returns the first of the month 2 months ago, which is what I want is there a better approach I could have used using timedeltas? I choose my way because weeks in a month are not always constant.

Advertisement

Answer

dateutil is an amazing thing. It really should become stdlib someday.

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