Skip to content
Advertisement

How to get the EOMONTH(End of month) of the current date using Python3

I have a SQL server stored procedure and I am trying to replicate it using python. One of the things I am trying to replicate is the following function:

JavaScript

Here is what I have tried in Python3:

JavaScript

Output:

JavaScript

The thing is, I have to enter the date (200,3,1). I want to be able to pick up the current date and output the End of month. Here is what I tried but to no avail:

JavaScript

Any suggestions or recommended solutions?

Advertisement

Answer

What about:

JavaScript

Or, you could use the calendar.monthrange method:

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