Ignition Report: Getting 1st day and last day of the month

To get first day of month is easy with an expression:

dateFormat(dateArithmetic(now(0),0,'days'), "yyyy-MM-01 00:00:00")

Output would become: 2018-09-01 00:00:00

To get last day of month you need to script a little (to my knowledge), and this is what i got to return how many days in current month (28, 30, 31 etc):

import calendar

today = datetime.today()
year, month = today.year, today.month
calendar.monthrange(year, month)[1]

Output would become (for month 9): 30

2 Likes