• [^] # Re: Locale

    Posté par (site web personnel) . En réponse au message Date - Inversion jour/mois. Évalué à 9. Dernière modification le 23 janvier 2021 à 06:33.

    Tout à fait d'accord avec toi pour la notation +.

    A priori, mauvaise piste pour les paramètres régionaux : date lui répond en français. Mais vérifions...

    La page de manuel :

     -d, --date=STRING
     display time described by STRING, not 'now'
    ...
    DATE STRING
     The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42
     -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating cal‐
     endar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty
     string indicates the beginning of the day. The date string format is more complex than is easily docu‐
     mented here but is fully described in the info documentation.
    

    La page info :

    28.2 Calendar date items
    ========================
    A "calendar date item" specifies a day of the year. It is specified
    differently, depending on whether the month is specified numerically or
    literally. All these strings specify the same calendar date:
     1972年09月24日 # ISO 8601.
     72-9-24 # Assume 19xx for 69 through 99,
     # 20xx for 00 through 68.
     72-09-24 # Leading zeros are ignored.
     9/24/72 # Common U.S. writing.
     24 September 1972
     24 Sept 72 # September has a special abbreviation.
     24 Sep 72 # Three-letter abbreviations always allowed.
     Sep 24, 1972
     24-sep-72
     24sep72
     The year can also be omitted. In this case, the last specified year
    is used, or the current year if none. For example:
     9/24
     sep 24
     Here are the rules.
     For numeric months, the ISO 8601 format ‘YEAR-MONTH-DAY’ is allowed,
    where YEAR is any positive number, MONTH is a number between 01 and 12,
    and DAY is a number between 01 and 31. A leading zero must be present
    if a number is less than ten. If YEAR is 68 or smaller, then 2000 is
    added to it; otherwise, if YEAR is less than 100, then 1900 is added to
    it. The construct ‘MONTH/DAY/YEAR’, popular in the United States, is
    accepted. Also ‘MONTH/DAY’, omitting the year.
     Literal months may be spelled out in full: ‘January’, ‘February’,
    ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’,
    ‘October’, ‘November’ or ‘December’. Literal months may be abbreviated
    to their first three letters, possibly followed by an abbreviating dot.
    It is also permitted to write ‘Sept’ instead of ‘September’.
     When months are written literally, the calendar date may be given as
    any of the following:
     DAY MONTH YEAR
     DAY MONTH
     MONTH DAY YEAR
     DAY-MONTH-YEAR
     Or, omitting the year:
     MONTH DAY
    

    La notation US est très ancrée...

    Pour ma part, je préfère toujours ISO 8601 (YYYY-MM-DD) pour toute date (aucune ambiguïté possible, ça se trie trivialement, etc.), et c'est accepté par date.

    Debian Consultant @ DEBAMAX