C++ Logo

std-proposals

Advanced search

Re: C++20 chrono library can't use max date?

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 20 Dec 2019 12:33:21 -0800
On Friday, 20 December 2019 09:22:15 PST Akira Takahashi via Std-Proposals
wrote:
> `std::chrono::year` class has 16-bits signed integer for year
> value. [-32767, 32767]
>
> However, `system_clock::time_point::max()` of libc++ implementation
> has 294247 years (microseconds based). So, C++20 chrono library can't use
> max date.
> Is this defect or correct?

It's correct.

And libstdc++ is even shorter, with just 294.2 years (nanosecond based).

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2019-12-20 14:35:57