Skip to main content
BEGINNING_OF_MONTH
Tom Williams avatar
Written by Tom Williams
Updated over a year ago

Type: Function

Function: BEGINNING_OF_MONTH

Syntax: BEGINNING_OF_MONTH(datetime)

Description: Returns a datetime corresponding to the beginning of month for the provided datetime or NOW if no value is provided.

Sample usage:

  • BEGINNING_OF_MONTH(created_at) returns the created_at field value set at midnight on the first day of the month. If created_at is equal to 2023-02-23T15:39:21Z then

    BEGINNING_OF_MONTH(created_at) returns 2023-02-01T00:00:00Z.

  • BEGINNING_OF_MONTH() is equal to BEGINNING_OF_MONTH(NOW())

  • BEGINNING_OF_MONTH(DATE(2023, 2, 15)) is equal to DATE(2023, 2, 1)

Did this answer your question?