From: Jeff King Date: Sun, 15 Feb 2026 09:13:46 GMT Subject: Re: [PATCH v2 1/2] http: add support for HTTP 429 rate limit retries Message-ID: <20260215091346.GB696020@coredump.intra.peff.net> In-Reply-To: On Fri, Feb 13, 2026 at 03:41:55PM +0200, Vaidas Pilkauskas wrote: > > There were lots of uses of "date" that I suspect may give us portability > > problems. "+%s" is not even in POSIX, but maybe it is universal enough. > > But stuff like '-d "+2 seconds"' seems likely to be a GNU-ism. > > > > Using "test-tool date" might get around some of that. We even understand > > relative dates like "2 seconds ago", but I think only in the past. :-/ > > So you'd probably have to do: > > > > now=$(test-tool date timestamp now | cut -d' ' -f3) > > then=$((now + 2)) > > test-tool date show:rfc2822 $then > > > > or something. > > I was not aware about test-tool, thanks! It might be a little awkward to bend it to your will, especially since it likes to print "input -> output" instead of just the output you want. If it gets too hairy, I wouldn't be opposed to teaching it a new option or even a new command-mode for doing this kind of computed date stuff. -Peff