git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git pull on ia64 linux tree

From
SMSanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Date
Apr 24, 2005, 05:02 UTC
Message-ID
<E1DPZGY-0000VJ-00@skye.ra.phy.cam.ac.uk>
In-Reply-To
<Pine.LNX.4.58.0504221521260.2344@ppc970.osdl.org>
Show 6 quoted lines
> I think it would be nice to use the TZ data to show the thing in the
> timezone of the committer, though. Dunno how to do that, maybe
> something like
>	TZ=$tz date -d "1970-01-01 + $sec sec"
> Sadly, it looks like "date" doesn't understand timezone syntax like
> that
Try:

negzone=`echo $tz | tr '[-]+' '+-'` date -u -R -d "1970-01-01 $negzone + $sec sec" | sed "s/+0000/$tz/"

Or as a script:

#!/bin/bash # usage: show-date.sh <utcseconds> <zone> negzone=`echo $2 | tr '[-]+' '+-'` date -u -R -d "1970-01-01 $negzone + $1 sec" | sed "s/+0000/$2/"

A simple test:

$ show-date.sh 10 +0200 Thu, 01 Jan 1970 02:00:10 +0200

Negating the timezone is an ugly workaround for date not understanding a sensible TZ format. I almost always use -u with date, otherwise I get confused about what timezone it is using to interpret and to print the date.

-Sanjoy
Previous: Linus Torvalds
Message 2 of 2 in “Re: git pull on ia64 linux tree”
  1. Linus TorvaldsApr 22, 2005
  2. Sanjoy MahajanApr 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.