Select to view content in your preferred language

Arcade: Month Function Returning Wrong Value

1838
3
Jump to solution
05-18-2022 08:58 AM
JustinReynolds
Frequent Contributor

Maybe I'm going crazy here, but the Month Function in Arcade is returning the Month - 1.  Anybody else seeing this behavior?

console(Now())
console(Month(Now()))

2022-05-18T10:41:34.875-05:00
4

 

- Justin Reynolds, PE
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You have to remember that Month is zero-based:

Returns the month of the given date. Values range from 0-11 where January is 0 and December is 11.

View solution in original post

3 Replies
KenBuja
MVP Esteemed Contributor

You have to remember that Month is zero-based:

Returns the month of the given date. Values range from 0-11 where January is 0 and December is 11.

JustinReynolds
Frequent Contributor

Guess I missed that in the documentation.  Makes sense.  Thanks

- Justin Reynolds, PE
0 Kudos
EricaNova
Frequent Contributor

I also just found this out the hard way and I just... cannot. This R user cannot get over the use of zero-based indexes for the month function... it just seems so counter-intuitive.

0 Kudos