Debezium always push timestamp fields in Kafka as UTC

2,538 views
Skip to first unread message

Gagan Agrawal

unread,
Oct 16, 2018, 4:47:09 AM10/16/18
to debezium
Hi,
In my case we have mysql server timezone as IST and hence timestamp fields are also in IST. However when debezium produces these events in Kafka, it converts them to UTC. 
E.g mysql timestamp field with IST value "2018-10-16 11:20:01" get's converted to "2018-10-16T06:50:01Z" in Kafka. Is there a way we can configure to push timestamp fields in same timezone i.e. in this case "2018-10-16 11:20:01" instead of "2018-10-16T06:50:01Z"?

John Psoroulas

unread,
Oct 16, 2018, 6:04:38 AM10/16/18
to debezium
Hi Gagan,

the following text is extracted from https://debezium.io/docs/connectors/mysql/

The TIMESTAMP type represents a timestamp without time zone information and is converted by MySQL from the server (or session’s) current time zone into UTC when writing and vice versa when reading back the value. Such columns are converted into an equivalent io.debezium.time.ZonedTimestamp in UTC based on the server (or session’s) current time zone. The timezone will be queried from the server by default. If this fails, it must be specified explicitly as a connector option using the database.serverTimezone option. So if for instance the database’s time zone (either globally or configured for the connector by means of aforementioned option) is "America/Los_Angeles", the TIMESTAMP value "2018-06-20 06:37:03" will be represented by a ZonedTimestamp with the value "2018-06-20T13:37:03Z".

this might help you.

regards,

John 

 

Gagan Agrawal

unread,
Oct 16, 2018, 6:32:27 AM10/16/18
to debezium
What I interpret from this is that debezium will always push message in Kafka as UTC and there is no way to push in IST string format. Is that correct understanding?

John Psoroulas

unread,
Oct 16, 2018, 6:46:31 AM10/16/18
to debezium
yes Gagan, I think so,
Debezium does not include timezone information.
Reply all
Reply to author
Forward
0 new messages