shadow-maint / shadow

Upstream shadow tree
Other
304 stars 232 forks source link

Revert #1058 #1060

Closed alejandro-colomar closed 1 month ago

alejandro-colomar commented 2 months ago
    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 commented 2 months ago
ikerexxe commented 2 months ago

This PR and https://github.com/shadow-maint/shadow/pull/1059 are driving me a bit crazy, so I will refrain from commenting on them.