Ghost's post routing logic ignores the site's configured time zone

Issue Summary
When Ghost performs post routing tasks that rely on the post’s date, those operations don’t seem to align with the site’s configured time zone. (And to be clear: this has nothing to do with Ghost printing a date via the {{date}} helper; that seems to operate as expected.)

  1. One way that this manifests is when filtering for posts using a route: the wrong posts will show up (or be left out) on the boundaries of that time range. See Set timezone when using published_at in routes

  2. This also manifests when using collections that incorporate the post’s published date. For instance, my site uses this as the only collection:

    collections:
      /:
        permalink: /{year}/{month}/{slug}/
        template: index
    

    However, a post that I published in the year of 2017 (in the site’s configured time zone of US Pacific Time), is shown with a year of 2018. Here’s part of a template I’m using for a yearly archive page:

          {{#get "posts" filter="published_at:>='{{archive_year}}-01-01 00:00:00'+published_at:<='{{archive_year}}-12-31 23:59:59'" limit="all"}}
          {{#foreach posts visibility="all"}}
            <article class="archive-post">
              <!-- {{date published_at format=""}} -->
              <time datetime="{{date published_at format="YYYY-MM-DD"}}"
                >{{date published_at format="DD MMM YYYY"}}
              </time>
    
              <h2 class="archive-post-title">
                <a class="archive-post-link" href="{{url}}">{{title}}</a>
              </h2>
            </article>
          {{/foreach}}
          {{/get}}
    

    And here’s what shows up at the beginning of the 2018 page (so archive_year == 2018):

            <article class="archive-post">
              <!-- 2017-12-31T21:31:00-08:00 -->
              <time datetime="2017-12-31"
                >31 Dec 2017
              </time>
    
              <h2 class="archive-post-title">
                <a class="archive-post-link" href="/2018/01/moments-in-between-25-hours-of-light/">Moments In Between: 25 Hours of Light and Darkness</a>
              </h2>
            </article>
    

    You can clearly see that the post date is stored with the appropriate time zone, but that the collection routing isn’t using that stored time zone in determining the appropriate year to use for the generated post URL.

Expected behavior
I would expect the post routing to follow the site’s configured timezone. This also implies that changing the site time zone may change post routes, if the collections are configured in that way.

I could imagine that behavior being configurable (especially for people who’ve already established site presences that assume the current behavior). But in my case, for instance, this discrepancy causes broken existing links that were originally pointed at a site that did respect time zones.


Setup information

Ghost Version
4.34.0

Node.js Version
14.18.1-deb-1nodesource1

How did you install Ghost?
Digital Ocean droplet with one-click Ghost install

Provide details of your host & operating system
Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-99-generic x86_64)

Linux blog 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

The system itself is using UTC:

$ cat /etc/timezone 
Etc/UTC

Database type
mysql-server-core-8.0: /usr/sbin/mysqld

Browser & OS version
n/a

Relevant log / error output
Here’s a screenshot showing the timezone configuration: