How do I get the number of days in the previous month? I am working on a calendar, and so far I know how to get the number of days in the current month.
{% set daysInMonth = time|date('t') %}

But how can I get the number of days in the previous month? 

Thanks in advance.
I believe: {{ now | date_modify('-1 month') | date('t') }}