Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add %F output format option to print timestamps in a human-readable format #351

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexey-sveshnikov
Copy link

@alexey-sveshnikov alexey-sveshnikov commented Nov 1, 2021

Hi Magnus!

I added %F format option to display timestamps in human-readable format.

I suggest a format that is compatible with both ISO8601 and RFC3399: 2021-11-01T23:04:35.113+0300.

Closes #189. Some code is borrowed from #216.

UPD: I see the failed CI job, going to check it later

Copy link
Owner

@edenhill edenhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Left some minor comments.

kcat.c Outdated Show resolved Hide resolved
format.c Show resolved Hide resolved
char buf[80];
format_timestamp(buf,
sizeof(buf),
rd_kafka_message_timestamp(rkmessage,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to check that tstype is valid, on older brokers (or message format versions) the tstype will be NONE and the timestamp unusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show message timestamp as UTC ISO8601 format
2 participants