mysql-binlog-connector-java icon indicating copy to clipboard operation
mysql-binlog-connector-java copied to clipboard

Datetime isn't necessarily in UTC (depend on timezone settings)

Open deamn opened this issue 4 years ago • 3 comments

Please see https://issues.apache.org/jira/browse/NIFI-5091

Could you update your fork with that pull request? https://github.com/shyiko/mysql-binlog-connector-java/pull/292

deamn avatar Aug 27 '20 13:08 deamn

hi, feel free to open a pull request here, but your PR isn't necessarily more correct than the existing code, and I feel like it would break quite a lot of code.

The existing code asserts that the server is always running in UTC, and ignores what timezone the client is in. Your code asserts that the server is always running in the timezone that the client is in.

Neither is correct; as far as I'm concerned the only correct thing to do here is to query the server and see what timezone it's in, and use that to convert the integers into dates.

osheroff avatar Aug 27 '20 16:08 osheroff

that's right

TymGitHub avatar Sep 09 '20 09:09 TymGitHub

代码中写死GMT,感觉不太好

TymGitHub avatar Sep 09 '20 09:09 TymGitHub