I am confused about how $dateTrunc
works. For example, consider the following:
`
ISODate(“2024-04-24T01:00:00Z”)
$dateTrunc: {
date: "$date",
unit: "hour",
binSize: 2,
timezone: "+02:00",
startOfWeek: "Monday"
}
`
In this case, I get the result: 2024-04-24T00:00:00Z
, which is correct. However, when I use the same input and corresponding timezone:
$dateTrunc: {
date: "$date",
unit: "hour",
binSize: 2,
timezone: "Europe/Warsaw",
startOfWeek: "Monday"
}
I get 2024-04-24T01:00:00Z
(where I should get the same result).
What is happening?