summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/std/time/clock/gps/io.cc
blob: 29f3148cf14bcf7f3e0cb5512e7b654e267d7bbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }

#include <chrono>
#include <format>
#include <testsuite_hooks.h>

void
test01()
{
  using std::format;
  using namespace std::chrono;

  auto st = sys_days{2000y/January/1};
  auto gt = clock_cast<gps_clock>(st);

  auto s = format("{0:%F %T %Z} == {1:%F %T %Z}", st, gt);
  VERIFY( s == "2000-01-01 00:00:00 UTC == 2000-01-01 00:00:13 GPS" );
}

int main()
{
  test01();
}