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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 28, 2014, 22:53 UTC
Message-ID
<xmqq61hc8bvq.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1409248189-31409-1-git-send-email-bbolli@ewanet.ch>
Beat Bolli <bbolli@ewanet.ch> writes:
> It uses the '%aI' and '%cI' format specifiers or the '--date=iso-strict'
> date format name.
OK.
>
> See http://article.gmane.org/gmane.comp.version-control.git/255879 for
> discussion.

Please think of a way to explain/justify your changes better before forcing readers to go online. In this case, I think what you wrote in the updates to the documentation would serve as a good basis for it (describe it backwards).

Show 9 quoted lines
> +The differences to the strict ISO 8601 format are:
> +
> +	- a space instead of the `T` date/time delimiter
> +	- a space between time and time zone
> +	- no colon between hours and minutes of the time zone
> +
> ...
> -`--date=iso` (or `--date=iso8601`) shows timestamps in ISO 8601 format.
> +`--date=iso` (or `--date=iso8601`) shows timestamps in a ISO 8601-like format.
Should it be s/a ISO/an ISO/?
Show 7 quoted lines
> +	else if (mode == DATE_ISO8601_STRICT)
> +		strbuf_addf(&timebuf, "%04d-%02d-%02dT%02d:%02d:%02d%+03d:%02d",
> +				tm->tm_year + 1900,
> +				tm->tm_mon + 1,
> +				tm->tm_mday,
> +				tm->tm_hour, tm->tm_min, tm->tm_sec,
> +				tz / 100, abs(tz % 100));

Wouldn't this misidentify a zone that is 30 minutes off of GMT, i.e. tz == -30? tz/100 would not be negative and "%+03d:" would happily show "+00:", no?

Previous: Beat BolliNext: Scott Schmit
Message 2 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.