DEV Community

Alex Dzyoba
Alex Dzyoba

Posted on • Originally published at on

tzconv - convert time between timezones

I made a nice little thing called tzconv It’s a CLI tool that converts time between timezones and it’s useful (at least for me) when you investigate done incident and need to match times.

Imagine, you had an incident that happened at 11:45 your local time but your logs in ELK or Splunk are in UTC. So, what time was 11:45 in UTC?

$ tzconv utc 11:45
Enter fullscreen mode Exit fullscreen mode

Boom! You got it!

You can add the third parameter to convert time from specific timezone, not from your local. For instance, your alert system sent you an email with a central European time and your server log timestamps are in Eastern time.

$ tzconv neyork 20:20 cet

Enter fullscreen mode Exit fullscreen mode

Note, that I’ve mistyped New York and it still worked. That’s because locations are not matched exactly but fuzzy searched!

You can find more examples in the project README. Feel free to contribute, I’ve got a couple of things I would like to see implemented – check the issues page. The tool itself is written in Go and quite simple yet useful.

That’s it for now, till the next time!

Top comments (0)