最終更新日時(UTC):
が更新

履歴 編集

function
<chrono>

std::chrono::year_month_day::day(C++20)

constexpr chrono::day day() const noexcept; // (1) C++20

概要

日要素を取得する。

戻り値

コンストラクタで設定されて保持している日オブジェクトを返す。

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;
using namespace std::chrono_literals;

int main()
{
  chrono::year_month_day date = 2020y/3/1;
  chrono::day d = date.day();
  assert(d == 1d);
}

出力

バージョン

言語

  • C++20

処理系

  • Clang: 8.0
  • GCC: (9.2時点で実装なし)
  • Visual C++: (2019 Update 3時点で実装なし)