Hi Brian, Paul,

On Tue, Feb 11, 2025 at 01:20:33PM -0700, Brian Inglis wrote:
> Hi Alex,
> 
> Use "T0" or " 0" zone offset prefix to make it work:

Hmmm, T0 is nice.  It's not exactly a time without a date, but it can be
a workaround.  As in, "I just don't care about the time; I'll put a 0".

> 
>       $ date -d2023-09-20T0+0200
>       2023 Sep 19 Tue 16:00:00
>       $ date -d2023-09-20\ 0+0200
>       2023 Sep 19 Tue 16:00:00
> 
> or maybe add [ T]12:00 to make it less ambiguous when dealing only with dates?

12:00 is ambiguous too.  As Paul pointed out back in August, there have
been days with 48 hours, and I suspect other days have been much shorter
than 24 hours.  In such cases, the 12:00 trick wouldn't be enough to
avoid ambiguity.  Also, I think timezones 13 hours away from UTC do
exist or have existed in the past, no?

I'd prefer a solution that avoids any ambiguity (or one that keeps the
ambiguity by not specifying a time at all).

> I agree that date with zone without time has a useful meaning, so allowing
> the time to be optional, defaulting to 0 as usual, in strptime(3) and
> date(1), would be useful.

Yeah, I guess T0 is a nice workaround.

> > > Now I remember, coreutils uses gnulib for that, as you told me some time
> > > ago.  It would be a gnulib report.  :)
> 
> Didn't you all go around on this last August in bug-gnulib?

Ahhh, I had forgotten about that thread.  Yes we did.
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00003.html>
We didn't really reach a consensus, though.

I now see a comment from Paul from back then:

| Fourth, RFC 9557 section 1.2 strongly discourages suffixes like
| "[+02:00]". That suffix means clocks never change in that location,
| which is historically inaccurate everywhere. Instead, you're supposed
| to use a suffix like "[Africa/Tripoli]". I view this as a major
| objection to Alejandro's proposal for the output of "passwd". 

I guess I could use [UTC].  Since I only want to print UTC dates, that
should work.  Does that sound more palatable?

| It might make sense to extend parse-datetime (and GNU date -d) to
| parse RFC 9557 [time-zone] suffixes, should they become popular.

| However, none of this should be needed for the 'passwd' command. For
| that, it's probably better just to stick with its current output,
| which is just a date without time zone

I'm not happy about it.  A date without a time zone is understood as a
local date.  However, what we store are UTC dates, so we'de be
misleading the reader.

I insist on a method for printing a date with a timezone but without a
time.  I'm especially interested in the UTC timezone.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to