Why Grafana weeks start on Thursday?

I have a need to prepare weekly stats on some of our metrics. Like for example weekly average memory usage or maximum weekly CPU %, or similar.
Further, I want this sliced on weeks starting on Monday and ending on Sunday.

I do an aggregation like this:

  • max(max_over_time(my_metric[1w]))
  • avg(avg_over_time(my_metric[1w]))

I then set the range in Grafana to show me last two weeks:

  • From: now-2w/w
  • To: now-1w/w

It properly shows the date range. At this specific timestamp of Friday, 9-Oct, it displays a range from 2020-09-20T22:00:00Z to 2020-10-04T21:59:00Z

Then I punch the query into Grafana.

If I click the Prometheus link I get proper query for Prometheus:
?g0.range_input=1209600s&g0.end_input=2020-10-04%2021%3A59&g0.step_input=604800
Range: 2 weeks x 7 days / week x 24 h / day x 60 min / h x 60 s / min = 1209600s. All good!
Step: 1 week x 7 days / week x 24 h / day x 60 min / h x 60 s / min = 604800. All good!

It’s now in UTC, and looks good. UI confirms it as well. See below.

Data fetched also looks good, with three data points, on the the beginning, one at the end and one in the middle (it’s two week range):

But if I inspect Grafana query, it is wrong:
start=1600293600&end=1601503200&step=604800
1600293600 translates into 2020-09-16T22:00:00Z, so I got a shift back for 4 days.

The calendar range is right, the query was wrong and correspondingly wrong results were fetched and plotted:

So, how do I get rid of this time shit getting into query for Prometheus?

can you show your complete query?

Query:
sum(sum_over_time(memgrid_tickets_gauge[1w]))
GET to Prometheus:
"api/datasources/proxy/2/api/v1/query_range?query=sum(sum_over_time(memgrid_tickets_gauge%5B1w%5D))%20&start=1600293600&end=1601503200&step=604800"
Link from Grafana to Prometheus Graph:
graph?g0.expr=sum(sum_over_time(memgrid_tickets_gauge%5B1w%5D))%20&g0.range_input=1209600s&g0.end_input=2020-10-04%2021%3A59&g0.step_input=604800&g0.tab=0

And the rest of the details: