osheroff / mysql-binlog-connector-java

MySQL Binary Log connector
679 stars 167 forks source link

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

Open deamn opened 4 years ago

deamn commented 4 years ago

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

osheroff commented 4 years ago

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.

TymGitHub commented 4 years ago

that's right

TymGitHub commented 4 years ago

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