[pacman-dev] [PATCH] Reformatting log timestamp to include time-zone

Allan McRae allan at archlinux.org
Fri Mar 8 00:02:59 UTC 2019

On 8/3/19 1:47 am, Dave Reisner wrote:
> On Thu, Mar 07, 2019 at 10:35:32AM +1000, Allan McRae wrote:
>> On 5/3/19 7:46 am, Florian Wehner wrote:
>>> The time logged is currently given as localtime without any time-zone
>>> information. This is confusing in various scenarios.
>>> Examples:
>>> * If one is travelling across time-zones and the timestamps in the log
>>> appear out of order.
>> Stop updating multiple times per hour!  :D
>>> * Comparing dates with `datediff` gives an offset by the time-zone
>>> This patch would reformat the time-stamp to a full ISO-8601 version.
>>> It includes the 'T' separating date and time. This could be removed.
>>> Old: [2019-03-04 16:15]
>>> New: [2019-03-04T16:15-05:00]
>> Can we switch from localtime() to gmtime() and just use UTC?
> I wouldn't do this... it's not normal to have local machine logs in
> another timezone. It'll make correlation harder if your natural timezone
> isn't already UTC. And, if we magically change the timezone with a new
> release of pacman and don't include the TZ explicitly in the timestamp,
> it's just going to be a source of confusion for people.
> I'm +1 on keeping localtime and explicitly adding the timezone
> identifier to the logline.

Fair enough.  The proposed patch looks fine then.  I will pull it when I
next get the chance.


More information about the pacman-dev mailing list