Incorrect Date Returned in Ignition Code

Hello Ignition Community,

I'm facing an issue with a piece of code in Ignition and would appreciate your assistance in understanding why the system is returning the wrong date. The code in question is as follows:



The expectation is to obtain the start of September (month = 9), but it is returning the start of October. Can someone help me understand why this is happening and how I can correct this issue?

Thank you in advance for your collaboration!

From the documentation:

January is 0 and December is 11



getDate(year, month, day) → Date

Creates a new Date object given a year, month, and day. Time is set to midnight.


int year - The year for the new date

int month - The month for the new date. January is month zero.

int day - The day of the month for the new date. The first day of the month is day 1.


A new Date object on midnight of the given day.