From b2e917ce6ca8dc11403772f6161b8f69f808c38b Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 1 Dec 2025 17:04:25 -0500 Subject: [PATCH] Bring leap_second up to spec * Adds value() member function. --- include/date/date.h | 1 + include/date/tz.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/date/date.h b/include/date/date.h index ded0ba2..29cecdc 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -7187,6 +7187,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, int tp = not_a_ampm; #if !ONLY_C_LOCALE tm = std::tm{}; + tm.tm_isdst = -1; tm.tm_hour = 1; ios::iostate err = ios::goodbit; f.get(is, nullptr, is, err, &tm, command, fmt+1); diff --git a/include/date/tz.h b/include/date/tz.h index 73b897b..e25a3ee 100644 --- a/include/date/tz.h +++ b/include/date/tz.h @@ -1014,7 +1014,8 @@ public: DATE_API explicit leap_second(const std::string& s, detail::undocumented); #endif - sys_seconds date() const {return date_;} + constexpr sys_seconds date() const noexcept {return date_;} + constexpr std::chrono::seconds value() const noexcept {return std::chrono::seconds{1};} friend bool operator==(const leap_second& x, const leap_second& y) {return x.date_ == y.date_;} friend bool operator< (const leap_second& x, const leap_second& y) {return x.date_ < y.date_;}