Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-260

Timestamp field not handle time zone correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 0.6.2
    • 0.5
    • mysql-connector
    • None

      Timestamp field in mysql is parsed as ZonedDateTime in DBZ, but with different TZ, the date time is always the UTC time.
      For me, the MySQL TZ is Asia/Shanghai (+08:00), a timestamp field '2017/03/14 18:07:52' is stored as epoch seconds 1489486072, which is '2017/3/14 10:07:52 UTC'.
      After parsed by debezium, the time is '2017/03/14 10:07:52+08:00', which is wrong and should be '2017/03/14 18:07:52+08:00'.
      Debug shows that when parsed by RowDesrializers, first the epoch seconds is retrieved from binlog, and convert to UTC time ('2017/03/14 10:07:52'). Then, TZ info is added, but the ZonedDateTime.of(LocalDateTime, ZoneId) just add TZ to date time but not handle the time offset.

              jpechane Jiri Pechanec
              alei.hanami Yelei Wu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: