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

Mark de Wever via All-commits all-commits at lists.llvm.org
Tue Apr 16 23:00:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6fcbcce8f79adfb2e4338859f3a41fc2538bad1
      https://github.com/llvm/llvm-project/commit/a6fcbcce8f79adfb2e4338859f3a41fc2538bad1
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2024-04-17 (Wed, 17 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. (#85797)

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