[arch-general] pacman.log has no timezone information in timestamp
Hi! I just used the /var/log/pacman.log for the first time to give me the last date-time I did a system upgrade ('starting full system upgrade' in the log). There is no time-zone info in the time-stamp. It's also not UTC. Does anyone know if this is by design or a bug? Example Output: [2019-03-01 16:59] [PACMAN] starting full system upgrade Expected Output: [2019-03-01 16:59-05:00] [PACMAN] starting full system upgrade It's confusing when you travel a lot or use 'datediff'. --Florian
On 01-03-2019 23:46, Florian Wehner wrote:
Hi!
I just used the /var/log/pacman.log for the first time to give me the last date-time I did a system upgrade ('starting full system upgrade' in the log). There is no time-zone info in the time-stamp. It's also not UTC. Does anyone know if this is by design or a bug?
Example Output: [2019-03-01 16:59] [PACMAN] starting full system upgrade Expected Output: [2019-03-01 16:59-05:00] [PACMAN] starting full system upgrade
It's confusing when you travel a lot or use 'datediff'.
--Florian
During installation you set a symlink from /etc/localtime to a timezone. I'm 99% sure the timezone set there is whats used by pacman.log . Lone_Wolf
I just used the /var/log/pacman.log for the first time to give me the last date-time I did a system upgrade ('starting full system upgrade' in the log). There is no time-zone info in the time-stamp. It's also not UTC. Does anyone know if this is by design or a bug? `pacman` uses local time of your system. Indeed it seems like an ommision.
You may consider opening a feature request, so pacman.conf would allow either an option to include TZ in the logs (good idea) or setting custom time format (worse idea, as this would bind `pacman` codebase to the specific time formatting function).
Am 02.03.19 um 01:12 schrieb mpan:
I just used the /var/log/pacman.log for the first time to give me the last date-time I did a system upgrade ('starting full system upgrade' in the log). There is no time-zone info in the time-stamp. It's also not UTC. Does anyone know if this is by design or a bug? `pacman` uses local time of your system. Indeed it seems like an ommision.
You may consider opening a feature request, so pacman.conf would allow either an option to include TZ in the logs (good idea) or setting custom time format (worse idea, as this would bind `pacman` codebase to the specific time formatting function).
Meanwhile you can explicitly set the timezone to UTC when calling pacman, that way the log will be consistent: $ TZ=UTC sudo pacman ... -- ProgAndy
`pacman` uses local time of your system. Indeed it seems like an ommision.
And the code says /* Use ISO-8601 date format */ - which is not entirely true :)
You may consider opening a feature request, so pacman.conf would allow either an option to include TZ in the logs (good idea) or setting custom time format (worse idea, as this would bind `pacman` codebase to the specific time formatting function).
I suggested a patch that just adds the time-zone-offset to the timestamp. Anyone interested can find it here: https://lists.archlinux.org/pipermail/pacman-dev/2019-March/023219.html --Florian
participants (4)
-
Florian Wehner
-
Lone_Wolf
-
mpan
-
ProgAndy