The UTC range for 2024 starts at 1704067200 and ends at the exclusive boundary 1735689600. The year has 366 days.

Use the year as a half-open range

WHERE event_time >= 1704067200
  AND event_time <  1735689600

The exclusive upper boundary is safer than “December 31 at 23:59:59.” It works whether the database stores whole seconds, milliseconds, or fractions of a second.

Month starts in UTC

Month start Unix seconds ISO 8601 UTC
January 1 1704067200 2024-01-01T00:00:00Z
February 1 1706745600 2024-02-01T00:00:00Z
March 1 1709251200 2024-03-01T00:00:00Z
April 1 1711929600 2024-04-01T00:00:00Z
May 1 1714521600 2024-05-01T00:00:00Z
June 1 1717200000 2024-06-01T00:00:00Z
July 1 1719792000 2024-07-01T00:00:00Z
August 1 1722470400 2024-08-01T00:00:00Z
September 1 1725148800 2024-09-01T00:00:00Z
October 1 1727740800 2024-10-01T00:00:00Z
November 1 1730419200 2024-11-01T00:00:00Z
December 1 1733011200 2024-12-01T00:00:00Z

Quarter boundaries

  • Q1: 1704067200 (2024-01-01T00:00:00Z)
  • Q2: 1711929600 (2024-04-01T00:00:00Z)
  • Q3: 1719792000 (2024-07-01T00:00:00Z)
  • Q4: 1727740800 (2024-10-01T00:00:00Z)
  • Next year: 1735689600 (2025-01-01T00:00:00Z)

These are UTC values. If the business timezone is not UTC, its local year begins at a different instant; calculate those boundaries in the named location before storing the result.