So imagine there are ~100 servers with different timezones (not all diff., but many-many timezones). There are outputs on the server logs like:

server1:BFE4C025   0420201413 P H sysplanar0     UNDETERMINED ERROR
server2:BFE4C025   0421032413 P H sysplanar0     UNDETERMINED ERROR

-> so they are in server time (different timezones) ->

0420201413 = 2013.04.20. 20:14
0421032413 = 2013.04.21 03:24

Converting ex.: 0421032413 to 2013.04.21 03:24 is trivial. But: again the server time differs, if I give out the "date" command on these two servers in the exact same time:

server1:Tue Apr 23 07:23:24 EDT 2013
server2:Tue Apr 23 13:23:24 MESZ 2013

I get this. But I need the mentioned logs (only that few line/server) in one timezone. Why? Because it's very-very usefull to know when did exactly things happen in your timezone, ex.: CET TZ.

Q: how can I convert the server logs time to Central European time?

2 Answers 2


If you just want to convert existing syslog files you can e.g. use a small python/perl/ruby program to change Tue Apr 23 07:23:24 EDT 2013 in something with UTC (or CET).

If you want to have more control over the time format that is written in the log file, you might want to look at syslog-ng. Its tsformat() function allows you to configure the time format e.g. to iso8601.

Having had to work with servers in 5 timezones myself, I can highly recommend going for UTC timestamps. With daylight savings not starting at the same time keeping track of what CET (or CEST) is in PST (or is it already PDT) is a nightmare.


You can use date to print date timestamp and store it with log message.

$ TZ='Europe/Warsaw' date
wto, 23 kwi 2013, 17:11:48 CEST
$ TZ='America/Los_Angeles' date
wto, 23 kwi 2013, 08:11:56 PDT
$ date --universal
wto, 23 kwi 2013, 15:13:14 UTC

Use tzselect to find time zones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.