Handling dates and times in SQL queries with PostgreSQL

(mon-code.net)

3 points | by metfan 3 days ago ago

1 comments

  • ruslanty 3 days ago

    For reports by local date, I’d convert both local midnights to timestamptz separately, then filter with ts >= start AND ts < end. If you take the first midnight and just add 24 hours, you can miss an hour or pull in an hour from the next day when the clocks change