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

Re: [PATCH] pretty: Provide a strict ISO8601 date format

From
SSScott Schmit <i.grok@comcast.net>
Date
Aug 29, 2014, 20:29 UTC
Message-ID
<20140829202916.GB10274@odin.ulthar.us>
In-Reply-To
<xmqq1trz6sv0.fsf@gitster.dls.corp.google.com>
On Fri, Aug 29, 2014 at 11:41:39AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> You feed tz/100 to "%+03d:" (the "sign and hour" part of the
> timezone).  What if tz is -30, i.e. less than an hour but still a
> negative offset?  tz/100 would be zero and tz % 100 would be -30.
> 
>     tz = -30;
>     printf("%+03d:%02d", tz / 100, abs(tz % 100));
> 
> would show what?
+00:30 because zero can't be negative in two's complement arithmetic.

The "-30 / 100 = 0" part didn't click for some reason. Sorry for the noise.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “pretty: Provide a strict ISO8601 date format”
  1. pretty: Provide a strict ISO8601 date formatBeat Bolli, Aug 28, 2014
  2. Junio C HamanoAug 28, 2014
  3. Scott SchmitAug 29, 2014
  4. Junio C HamanoAug 29, 2014
  5. Scott SchmitAug 29, 2014
  6. Junio C HamanoAug 29, 2014

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.