The UTC range for 2027 starts at 1798761600 and ends at the exclusive boundary 1830297600. The year has 365 days.

Use the year as a half-open range

WHERE event_time >= 1798761600
  AND event_time <  1830297600

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 1798761600 2027-01-01T00:00:00Z
February 1 1801440000 2027-02-01T00:00:00Z
March 1 1803859200 2027-03-01T00:00:00Z
April 1 1806537600 2027-04-01T00:00:00Z
May 1 1809129600 2027-05-01T00:00:00Z
June 1 1811808000 2027-06-01T00:00:00Z
July 1 1814400000 2027-07-01T00:00:00Z
August 1 1817078400 2027-08-01T00:00:00Z
September 1 1819756800 2027-09-01T00:00:00Z
October 1 1822348800 2027-10-01T00:00:00Z
November 1 1825027200 2027-11-01T00:00:00Z
December 1 1827619200 2027-12-01T00:00:00Z

Quarter boundaries

  • Q1: 1798761600 (2027-01-01T00:00:00Z)
  • Q2: 1806537600 (2027-04-01T00:00:00Z)
  • Q3: 1814400000 (2027-07-01T00:00:00Z)
  • Q4: 1822348800 (2027-10-01T00:00:00Z)
  • Next year: 1830297600 (2028-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.