Re: [PATCH 3/3] gitk: Allow displaying time zones from author and commit timestamps

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

 



On Mon, 30 May 2011, Jakub Narebski wrote:
> > > Why not use UTC+N timezone [â]?
> 
> I think full specification is UTC+HH:MM or UTC-HH:MM.  GNU date
> understands 'TZ=UTC+09:30 date'.

No, thatâs not what the letter code in TZ means.  TZ=EDT+04:00 means that
  â The current time zone is called EDT.
  â The current time zone is at offset -04:00 from UTC.  (Note the sign 
    reversal.)
EDT is displayed as the name of the zone and is not used in any 
calculations; it does not mean weâre taking an offset _from_ EDT.

So it doesnât make sense to write TZ=UTCÂNN:NN for any NN:NN other than 
00:00.  Otherwise libc will happily give you the nonsense that you asked 
for:
  $ TZ=UTC+00:00 date; TZ=UTC+09:30 date
  Mon May 30 21:21:32 UTC 2011
  Mon May 30 11:51:32 UTC 2011

This is why I used âUnknownâ instead of âUTCâ.

(Oh, my comment should have said âUnknownÂNN:NNâ instead of 
âUnknownÂNNNNâ; the code gets it right.)

If I wanted to do better, Iâd need a way to translate UTC offsets to zone 
names, but I donât know of a canonical way to do that (thereâs not even a 
unique answer in general).

In Tcl â 8.5, none of this matters because âclock format -timezoneâ just 
uses the numerical UTC offset as the zone name.  For the fallback code, I 
canât do that by manipulating TZ, because the zone name needs to be made 
of letters.

Anders
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]