Quick question about "1st day of month" template

What’s the specific difference between the two below. I need for it to identify when it’s the first day of the month. I’m not sure which would work better.

'{{ now().day == 1 }}'


'{{ now().timetuple().tm_yday == 1 }}'

The two are not equivalent.

  • now().day reports the day of the month.

  • now().timetuple().tm_yday reports the day of the year.

They happen to be the same right now only because we are currently in the month of January.

Thank you for explaining.

1 Like