Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #1058 #1060

Closed
Closed

Conversation

alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Aug 3, 2024

    Revert "lib/, src/: Use local time for human-readable dates"
    
    This reverts commit 3f5b4b56268269fefed55aa106f382037297d663.
    
    Time-zone conversion of day-precision timestamps is lossy.  Since the
    timestamps are stored as UTC, let's print them as UTC.  That allows
    users to see the actual value that is stored, and thus the value that
    would be used for comparison, for example for deciding if a login is
    valid.
    
    In the following commit, we add time-zone information to the strings,
    which should allow users understand any discrepancy between the date
    input (by default in local time), and the printed one (always in UTC).
    lib/time/day_to_str.h: day_to_str(): Print time-zone information together with dates
    
    We print dates as UTC dates, but unqualified dates are understood to be
    in local time.  Thus, we need to expressely mark them as UTC dates.
    
    In ISO mode, append a 'Z' without space.  In the current locale, since
    we don't know the format, append the ' UTC'.

Link: https://en.wikipedia.org/wiki/ISO_8601#Local_time_(unqualified)
Link: https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00015.html
Cc: @hallyn
Cc: @ikerexxe
Cc: @bhaible
Cc: @eggert
Cc: @kenion


Revisions:

v1b
  • Rebase
$ git range-diff gh/time..gh/time2 time..time2
1:  57b44b4c = 1:  7cdca6d8 Revert "lib/, src/: Use local time for human-readable dates"
2:  ded86651 = 2:  746e9c49 lib/time/day_to_str.h: day_to_str(): Print time-zone information together with dates
3:  c05f8ae1 < -:  -------- po/es.po: wsfix

@alejandro-colomar
Copy link
Collaborator Author

alejandro-colomar commented Aug 3, 2024

@ikerexxe
Copy link
Collaborator

ikerexxe commented Aug 6, 2024

This PR and #1059 are driving me a bit crazy, so I will refrain from commenting on them.

There were several custom date/time format strings.  Replace them by %c
so that the user gets the right date/time string, according to their
locale.

%c is specified by ISO C89.

Signed-off-by: Alejandro Colomar <[email protected]>
This reverts commit 3f5b4b5.

Time-zone conversion of day-precision timestamps is lossy.  Since the
timestamps are stored as UTC, let's print them as UTC.  That allows
users to see the actual value that is stored, and thus the value that
would be used for comparison, for example for deciding if a login is
valid.

In the following commit, we add time-zone information to the strings,
which should allow users understand any discrepancy between the date
input (by default in local time), and the printed one (always in UTC).

Link: <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00015.html>
Cc: Serge Hallyn <[email protected]>
Cc: Iker Pedrosa <[email protected]>
Cc: Bruno Haible <[email protected]>
Cc: Paul Eggert <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
…ther with dates

We print dates as UTC dates, but unqualified dates are understood to be
in local time.  Thus, we need to expressely mark them as UTC dates.

In ISO mode, append a 'Z' without space.  In the current locale, since
we don't know the format, append the ' UTC'.

Link: <https://en.wikipedia.org/wiki/ISO_8601#Local_time_(unqualified)>
Link: <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00015.html>
Cc: Serge Hallyn <[email protected]>
Cc: Iker Pedrosa <[email protected]>
Cc: Bruno Haible <[email protected]>
Cc: Paul Eggert <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants