Do I refer to the previous month or to the last month

I'd like to ask about the difference between "last month" and "previous month", if there is any.

I am a software developer and I use those relative words as a search input values for date search.

I am wondering, whether last month is correct if I want to refer to the previous month or not.


Last month is normally used to refer to the month before the current month.

Previous month is normally used to refer to the month before a month that is being spoken of. Thus you have something like "It rained a lot in March but not as much as in the previous month" referring to February.