[all-commits] [llvm/llvm-project] cb87ec: [libc++][TZDB] Improves time zone format specifiers.

Mark de Wever via All-commits all-commits at lists.llvm.org
Wed Apr 10 08:58:37 PDT 2024


  Branch: refs/heads/users/mordante/fixes_chrono_formatter_time_zone_information
  Home:   https://github.com/llvm/llvm-project
  Commit: cb87ecc505cf538eaa657a7cc3b1b282e3e7298d
      https://github.com/llvm/llvm-project/commit/cb87ecc505cf538eaa657a7cc3b1b282e3e7298d
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2024-04-10 (Wed, 10 Apr 2024)

  Changed paths:
    M libcxx/include/__chrono/formatter.h
    M libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
    M libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp

  Log Message:
  -----------
  [libc++][TZDB] Improves time zone format specifiers.

Per [tab:time.format.spec]
%z  The offset from UTC as specified in ISO 8601-1:2019, subclause
    5.3.4.1. For example -0430 refers to 4 hours 30 minutes behind UTC.
    If the offset is zero, +0000 is used. The modified commands %Ez and
    %Oz insert a : between the hours and minutes: -04:30. If the offset
    information is not available, an exception of type format_error is
    thrown.

Typically the modified versions Oz or Ez would have wording like

  The modified command %OS produces the locale's alternative
  representation.

In this case the modified version does not depend on the locale.

This change is a preparation for formatting sys_info which has time zone
information. The function time_put<_CharT>::put() does not have proper
time zone support, therefore it's a manual implementation.

Fixes https://github.com/llvm/llvm-project/issues/78184



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list