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

履歴 編集

function
<chrono>

std::chrono::high_resolution_clock::now(C++11)

static time_point now() noexcept;

概要

現在日時を取得する

戻り値

現在日時を指すtime_point

例外

投げない

#include <iostream>
#include <chrono>

using namespace std::chrono;

int main()
{
  high_resolution_clock::time_point p = high_resolution_clock::now();

  seconds d = duration_cast<seconds>(p.time_since_epoch());
  std::cout << d.count() << std::endl;
}

出力例

1317184255

バージョン

言語

  • C++11

処理系