Skip to main content

ISMONTH

Checks if a date is within a specific month.

Description

Determines if a given date or an array of dates falls within a specified month. It can handle single date timestamps or arrays of dates, optionally extracting dates from objects.

Syntax

ISMONTH(dateitems, month, [key])

Arguments

  • dateitems: A Unix timestamp (number) or an array of Unix timestamps or objects containing timestamps.
  • month: The month (1-12) to check against.
  • [key]: (Optional) If dateitems is an array of objects, this key specifies the property containing the Unix timestamp.

Example

ISMONTH(1678886400, 3) → Returns TRUE (March 17, 2023).
ISMONTH([1678886400, 1681996800], 3) → Returns [1678886400] (March 17, 2023 is in March, April 20, 2023 is not).
ISMONTH([{date: 1678886400}, {date: 1681996800}], 3, "date") → Returns [{date: 1678886400}].

Usage Notes:

  • The function uses AnyDB Date/Time items in Unix timestamps for date representation.
  • If dateitems is a single number, it returns TRUE or FALSE.
  • If dateitems is an array, it returns a filtered array containing only the dates that fall within the specified month.
  • If a key is provided and dateitems is an array of objects, the function extracts the timestamp from the object using the specified key.
  • The function operates in UTC timezone.
  • Month is a number between 1 and 12.