sapling icon indicating copy to clipboard operation
sapling copied to clipboard

Incorrect date display in log templates

Open rbehrends opened this issue 3 years ago • 0 comments

When using date in conjunction with the isodate, isodatesec, rfc3339date, and rfc822date filters or with the date() function, this results in incorrect output. The timezone display is scrambled (sign inverted, hours and minutes swapped) and the actual date is off by a number of minutes that seem to be related to the timezone offset. The normal log format is not affected.

Steps to reproduce:

$ sl clone https://github.com/facebook/sapling
$ cd sapling
$ sl goto e3b8a6d7ab3055b725f96f87020b0bdac466d05b
$ sl log -r . -T '{date|rfc822date}'
Sat, 19 Nov 2022 20:50:31 +0008
$ sl log -r . -T '{date|isodatesec}'
2022-11-19 20:50:31 +0008
$ sl log -r . -T '{date(date)}'
Sat Nov 19 20:50:31 2022 +0008
$ sl log -r .
changeset:   e3b8a6d7ab3055b725f96f87020b0bdac466d05b  (@)
user:        Open Source Bot <[email protected]>
date:        Sat, 19 Nov 2022 21:42:31 +0100
summary:     Updating submodules

The error interestingly doesn't appear when processing time output. While time shows the current time rather than that of the commit and thus can't be used as a workaround, it may help with pinpointing the error.

rbehrends avatar Nov 20 '22 17:11 rbehrends