Re: [PATCH 2/2] date: use localtime() for "-local" time formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



René Scharfe <l.s.r@xxxxxx> writes:

> Am 15.06.2017 um 15:52 schrieb Jeff King:
>> But for the special case of the "-local" formats, we can
>> just skip the adjustment and use localtime() instead of
>> gmtime(). This makes --date=format-local:%Z work correctly,
>> showing the local timezone instead of an empty string.
>
> Documentation/rev-list-options.txt should be updated to mention that %Z
> is passed to strftime in the local case, no?
>
>> The new test checks the result for "UTC", our default
>> test-lib value for $TZ. Using something like EST5 might be
>> more interesting, but the actual zone string is
>> system-dependent (for instance, on my system it expands to
>> just EST). Hopefully "UTC" is vanilla enough that every
>> system treats it the same.
>>
>> Signed-off-by: Jeff King <peff@xxxxxxxx>
>> ---
>> I don't have a Windows system to test this on, but from the output Dscho
>> provided earlier, I believe this should pass.
>
> The first patch applies with some fuzz on master of Git for Windows, the
> second one applies cleanly.  A "typedef unsigned long timestamp_t;" is
> required to compile it; such a fixup won't be needed for long, I guess.
> t0006 succeeds.

This time, I'll do s/timestamp_t/unsigned long/ while queuing ;-)
Of course, it needs to be converted back to timestamp_t when the
topic is merged to a more recent integration branch that knows about
the type.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]