[all-commits] [llvm/llvm-project] b9f3d2: [libc++][format] Fixes times before epoch.

Mark de Wever via All-commits all-commits at lists.llvm.org
Tue Jul 18 12:17:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9f3d241f46c1d2cae42b01e72ef34a18d84c319
      https://github.com/llvm/llvm-project/commit/b9f3d241f46c1d2cae42b01e72ef34a18d84c319
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

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

  Log Message:
  -----------
  [libc++][format] Fixes times before epoch.

The number of days should be rounded down, for both positive and
negative times since epoch. The original code truncated, which is
correct for positive values, but wrong for negative values.

Depends on D138826

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154865




More information about the All-commits mailing list