mattinbits commented on issue #21171:
URL: https://github.com/apache/airflow/issues/21171#issuecomment-1030046592
@ashb I experimented with using `datetimeoffset` rather than `datetime2` but
unfortunately it doesn't seem to help so long as we use `func.now()` mapping to
`GETDATE()`. I get this surprising result:
```
CREATE TABLE foo (tz_dt datetimeoffset);
INSERT INTO foo VALUES
('2022-02-04 16:00 +00:00'),
('2022-02-04 16:00 +01:00');
SELECT tz_dt, GETDATE() as now FROM foo
WHERE tz_dt < GETDATE();
```
This returns a result asserting that 16:00 CET is before 15:34 CET:
```
tz_dt | now
------------------------------------------|-----------------------------
2022-02-04 16:00:00.0000000 +01:00 | 2022-02-04 15:34:17.117
```
I assume the datetimeoffset is being converted to a naive value in UTC
(15:00) and then compared.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]