Skip to content

Repo sync for protected CLA branch #3931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/standard-library/chrono.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: <chrono>"
title: "<chrono>"
ms.date: 05/20/2022
ms.date: 05/25/2022
f1_keywords: ["<chrono>", "chrono/std::chrono::nanoseconds", "chrono/std::chrono::minutes", "chrono/std::chrono::seconds", "chrono/std::chrono::hours", "chrono/std::chrono::milliseconds", "chrono/std::chrono::microseconds"]
---

Expand All @@ -14,16 +14,18 @@ Beginning in Visual Studio 2015, the implementation of `steady_clock` has change
- `high_resolution_clock` is now a typedef for `steady_clock`
In the Microsoft C++ implementation, `steady_clock::time_point` is now a `typedef` for `chrono::time_point<steady_clock>`. However, this isn't necessarily the case for other implementations.

Time zones are changed over time by regional legislatures. Leap seconds are added by an international standards body. OS support for a database of these changes was added to Windows 10.
- Updates to the leap second database require Windows 10 version 1809 or later.
- Time zone support requires `icu.dll`, which is provided by Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Windows Server 2019 is based on Windows 10 version 1809.

Use of the time-zone facilities when running on older versions of Windows results in a runtime error.

## Requirements

**Header:** `<chrono>`

Regional legislatures occasionally make changes to time zones. OS support for a database of these changes was added to Windows 10.

An international standards body specifies when new leap seconds should be accounted for. A database of leap second updates was added to Windows 10.

- Updates to the leap second database require Windows 10 version 1809 or later.
- Time zone support requires Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Time zone support is available on Windows Server 2019 when the latest Windows updates are applied.
- Using the time-zone facilities on older versions of Windows results in a runtime error.

**Namespace:** `std`

## Calendrical types
Expand Down
10 changes: 7 additions & 3 deletions docs/standard-library/leap-second-class.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
description: "Learn more about: leap_second class"
title: "leap_second class"
ms.date: 06/7/2021
ms.date: 05/25/2022
f1_keywords: ["chrono/std::chrono::leap_second", "chrono/std::chrono::leap_second::date", "chrono/std::chrono::leap_second::value"]
helpviewer_keywords: ["std::chrono [C++], leap_second class", "std::chrono::leap_second::date function", "std::chrono::leap_second::value function"]
---
# `leap_second` class

A `leap_second` represents a date and a value for an inserted leap second. The library creates `leap_second` objects as part of its time zone database initialization. It provides **`const`** access to the created objects. You can't construct or copy a `leap_second` object, and use of the default move constructor or default move assignment operator results in undefined behavior.

Microsoft C++ supports the `leap_second` class starting in Visual Studio 2019 version 16.10. The `leap_second` class is a C++20 feature. The [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option is required.

## Syntax

```cpp
Expand All @@ -29,6 +27,12 @@ class leap_second // Since C++20

**Header:** `<chrono>`

Microsoft C++ supports the `leap_second` class starting in Visual Studio 2019 version 16.10. The `leap_second` class is a C++20 feature. The [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option is required.

An international standards body specifies when leap seconds should be accounted for. A database of leap second changes and when they were introduced was added to Windows 10.

To get updates to the leap second database, you need Windows 10 version 1809 or later.

**Namespace:** `std::chrono`

**Compiler Option:** [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md)
Expand Down
8 changes: 6 additions & 2 deletions docs/standard-library/leap-second-info-struct.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ helpviewer_keywords: ["std::chrono [C++], leap_second_info struct", "std::chrono

Call [`get_leap_second_info`](./chrono-functions.md#std-chrono-get-leap-second-info) to get a `leap_second_info`. This type only has public data members. It doesn't have base classes or members other than the ones specified.

Microsoft C++ supports the `leap_second_info` struct starting in Visual Studio 2019 version 16.10. The `leap_second_info` struct is a C++20 feature. The [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option is required.

## Syntax

```cpp
Expand All @@ -28,6 +26,12 @@ struct leap_second_info; // C++20

**Header:** `<chrono>`

Microsoft C++ supports the `leap_second` class starting in Visual Studio 2019 version 16.10. The `leap_second` class is a C++20 feature. The [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option is required.

An international standards body specifies when new leap seconds should be accounted for. A database of leap second updates was added to Windows 10.

To get updates to the leap second database, you need Windows 10 version 1809 or later.

**Namespace:** `std::chrono`

## See also
Expand Down
8 changes: 7 additions & 1 deletion docs/standard-library/time-zone-class.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: time_zone class"
title: "time_zone class"
ms.date: 09/30/2021
ms.date: 05/23/2022
f1_keywords: ["chrono/std::chrono::time_zone::name", "chrono/std::chrono::time_zone::get_info", "chrono/std::chrono::time_zone::to_sys", "chrono/std::chrono::time_zone::to_local"]
helpviewer_keywords: ["std::chrono [C++], time_zone class", "std::chrono::time_zone::name function", "std::chrono::time_zone::get_info function", "std::chrono::time_zone::to_sys function", "std::chrono::time_zone::to_local function"]
---
Expand Down Expand Up @@ -45,6 +45,12 @@ Microsoft C++ supports the `time_zone` class starting in Visual Studio 2019 vers

**Header:** `<chrono>`

At this time, time-zone data is only available on Windows version 19H1, and later. If you’re running on a version earlier than 19H1, you’ll get an exception: "The specified module could not be found".

Regional legislatures occasionally make changes to time zones. OS support for a database of these changes was added to Windows 10.

Time zone support requires Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Time zone support is available on Windows Server 2019 when the latest Windows updates are applied.

**Namespace:** `std::chrono`

## <a name="std-chrono-time-zone-get-info"></a> `get_info`
Expand Down
11 changes: 7 additions & 4 deletions docs/standard-library/time-zone-link-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ Although this type has a default move constructor and move assignment operator,

**Differences with IANA database**

In Microsoft's implementation, time zone data can differ in some cases from the Internet Assigned Numbers Authority (IANA) time zone database. For example, `"America/Nuuk"` is returned instead of `"America/Godthab"` (`"America/Nuuk"` was renamed `"America/Godthab"` in April 2020). We don't supply the `"Eastern War Time EWT"` time zone at this time. See [Issue #1786](https://github.com/microsoft/STL/issues/1786) on the Microsoft STL GitHub repo for more details.

> [!NOTE]
> At this time, time-zone data is only available on Windows version 19H1, and later. If you’re running on a version earlier than 19H1, you’ll get an exception: "The specified module could not be found".
In Microsoft's implementation, time zone data can differ in some cases from the Internet Assigned Numbers Authority (IANA) time zone database. For example, `"America/Nuuk"` is returned instead of `"America/Godthab"` (`"America/Nuuk"` was renamed `"America/Godthab"` in April 2020). We don't supply the `"Eastern War Time EWT"` time zone at this time. For more information, see [Issue #1786](https://github.com/microsoft/STL/issues/1786) on the Microsoft STL GitHub repo.

## Members

Expand All @@ -48,6 +45,12 @@ In Microsoft's implementation, time zone data can differ in some cases from the

**Header:** `<chrono>`

At this time, time-zone data is only available on Windows version 19H1, and later. If you’re running on a version earlier than 19H1, you’ll get an exception: "The specified module could not be found".

Regional legislatures occasionally make changes to time zones. OS support for a database of these changes was added to Windows 10.

Time zone support requires Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Time zone support is available on Windows Server 2019 when the latest Windows updates are applied.

**Namespace:** `std::chrono`

**Compiler Option:** [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md)
Expand Down
10 changes: 8 additions & 2 deletions docs/standard-library/zoned-time-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class zoned_time ; // C++20

A `zoned_time` always refers to a valid time zone and represents a point in time that exists and isn't ambiguous in that time zone.

Microsoft C++ supports the `zoned_time` class starting in Visual Studio 2019 version 16.10.

## Members

|Name|Description|
Expand Down Expand Up @@ -54,6 +52,14 @@ Microsoft C++ supports the `zoned_time` class starting in Visual Studio 2019 ver

**Header:** `<chrono>`

Microsoft C++ supports the `zoned_time` class starting in Visual Studio 2019 version 16.10.

At this time, time-zone data is only available on Windows version 19H1, and later. If you’re running on a version earlier than 19H1, you’ll get an exception: "The specified module could not be found".

Regional legislatures occasionally make changes to time zones. OS support for a database of these changes was added to Windows 10.

Time zone support requires Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Time zone support is available on Windows Server 2019 when the latest Windows updates are applied.

**Namespace:** `std::chrono`

**Compiler Option:** [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md)
Expand Down
6 changes: 4 additions & 2 deletions docs/standard-library/zoned-traits-struct.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ struct zoned_traits<const time_zone*>; // C++20

The pointer to the type that you supply doesn't have to provide the static functions `default_zone()` or `locate_zone()`. But if it doesn't, the `zoned_time` constructors won't be considered during overload resolution.

Microsoft C++ supports `zoned_traits` starting in Visual Studio 2019 version 16.10.

## Members

|Name|Description|
Expand All @@ -48,6 +46,10 @@ Microsoft C++ supports `zoned_traits` starting in Visual Studio 2019 version 16.

**Compiler Option:** [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md)

Microsoft C++ supports `zoned_traits` class starting in Visual Studio 2019 version 16.10.

Time zone support requires Windows 10 version 1903/19H1 or later. This requirement applies to both client and server operating systems. Time zone support is available on Windows Server 2019 when the latest Windows updates are applied.

## <a name="default_zone"></a> `default_zone`

Gets the [`time_zone`](time-zone-class.md) for the default time zone. For more information about how this works, see the code [example](#example-zoned_traits) at the end of this topic.
Expand Down