You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include the standard header `<chrono>` to define classes and functions that represent and manipulate time durations and time instants.
11
11
12
-
Beginning in Visual Studio 2015, the implementation of `steady_clock` has changed to meet the C++ Standard requirements for steadiness and monotonicity. `steady_clock` is now based on `QueryPerformanceCounter()`, and `high_resolution_clock` is now a typedef for `steady_clock`. As a result, in the Microsoft C++ compiler `steady_clock::time_point` is now a `typedef` for `chrono::time_point<steady_clock>`; however, this rule isn't necessarily the case for other implementations.
12
+
Beginning in Visual Studio 2015, the implementation of `steady_clock` has changed to meet the C++ Standard requirements for steadiness and monotonicity:
13
+
-`steady_clock` is now based on `QueryPerformanceCounter()`
14
+
-`high_resolution_clock` is now a typedef for `steady_clock`
15
+
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.
13
16
14
17
## Requirements
15
18
@@ -26,7 +29,7 @@ Beginning in Visual Studio 2015, the implementation of `steady_clock` has change
26
29
|[`duration` class](duration-class.md)| A time interval. |
27
30
|[`duration_values` struct](duration-values-structure.md)|Provides specific values for the `duration` template parameter `Rep`.|
28
31
|[`hh_mm_ss` class](hhmmss-class.md)| Splits a [`duration`](duration-class.md) into hours:minutes:seconds. |
29
-
|[`last_spec`](last-spec-struct.md)| Used to indicate the last item in a sequence, such as the last day of the week, when creating a calendrical type. |
32
+
|[`last_spec`](last-spec-struct.md)| Used to indicate the last item in a month such as last day of the week of a month (the last Tuesday of February 2020) or the last day of a month (the last day of April 2019). |
30
33
|[`leap_second` class](leap-second-class.md)| A date and a value for an inserted leap second. |
31
34
|[`leap_second_info` struct](leap-second-info-struct.md)| The data returned by [`get_leap_second_info`](chrono-functions.md#std-chrono-get-leap-second-info). |
32
35
|[`month` class](month-class.md)| A month of a year. For example, July. |
@@ -49,21 +52,21 @@ Beginning in Visual Studio 2015, the implementation of `steady_clock` has change
49
52
50
53
| Name | Description |
51
54
|--|--|
52
-
|[`file_clock` class](file-clock-class.md)|A clock that is an alias for the clock used for `std::filesystem::file_time_type` used to express file timestamps.|
55
+
|[`file_clock` class](file-clock-class.md)|An alias for the clock used for `std::filesystem::file_time_type`, which is used to express file timestamps.|
53
56
|[`gps_clock` class](gps-clock-class.md)| A clock that keeps GPS time. Measures time starting from the first Sunday of January 1980 at 00:00:00 UTC.|
54
57
|[`high_resolution_clock` struct](high-resolution-clock-struct.md)| A clock with a nanosecond tick period. |
55
-
|[`local_t` struct](local_t.md)| A pseudo-clock used as an argument to the `time_point` template argument to indicate that the time_point represents local time. |
56
-
|[`steady_clock` struct](steady-clock-struct.md)|A `steady` clock. Preferred for measuring time intervals. |
57
-
|[`system_clock` struct](system-clock-structure.md)|A *`clock type`* that is based on the real-time clock of the system.|
58
-
|[`tai_clock` class](tai-clock-class.md)| Measures International Atomic Time (TAI) starting from Thursday, January 1, 1958 at 00:00:00. Doesn't account for leap seconds.|
59
-
|[`utc_clock` class](utc-clock-class.md)| Measures time since 00:00:00 UTC on Thursday, January 1, 1970. This clock accounts for leap seconds and is the time standard used around the world.|
58
+
|[`local_t` struct](local_t.md)| A pseudo-clock used as an argument to the `time_point` template to indicate that the `time_point` represents local time. |
59
+
|[`steady_clock` struct](steady-clock-struct.md)|A `steady` clock. This clock is preferred for measuring time intervals. |
60
+
|[`system_clock` struct](system-clock-structure.md)|A clock based on the real-time clock of the system.|
61
+
|[`tai_clock` class](tai-clock-class.md)| Measures International Atomic Time (TAI) starting from Thursday, January 1, 1958 at 00:00:00. This clock doesn't account for leap seconds.|
62
+
|[`utc_clock` class](utc-clock-class.md)| Measures time since 00:00:00 UTC on Thursday, January 1, 1970. This clock accounts for leap seconds, and is the time standard used around the world.|
60
63
61
64
**Time Zones**
62
65
63
66
| Name | Description |
64
67
|--|--|
65
68
|[`time_zone` class](time-zone-class.md)| All time zone transitions for a specific geographic area. |
66
-
|[`time_zone_link` class](time-zone-link-class.md)|Specifies an alternative name for a `time_zone`. |
69
+
|[`time_zone_link` class](time-zone-link-class.md)|An alternative name for a `time_zone`. |
67
70
68
71
## Functions
69
72
@@ -121,8 +124,8 @@ For more information about ratio types that are used in the following typedefs,
121
124
| Name | Description |
122
125
|--|--|
123
126
|`typedef duration<long long, nano> nanoseconds;`| Synonym for a `duration` type that has a tick period of one billionth (1/1,000,000,000) of a second. |
124
-
|`typedef duration<long long, micro> microseconds;`| Synonym for a `duration` type that has a tick period of onemillionth (1/1,000,000) of a second. |
125
-
|`typedef duration<long long, milli> milliseconds;`| Synonym for a `duration` type that has a tick period of onethousandth (1/1,000) of a second. |
127
+
|`typedef duration<long long, micro> microseconds;`| Synonym for a `duration` type that has a tick period of one-millionth (1/1,000,000) of a second. |
128
+
|`typedef duration<long long, milli> milliseconds;`| Synonym for a `duration` type that has a tick period of one-thousandth (1/1,000) of a second. |
126
129
|`typedef duration<long long> seconds;`| Synonym for a `duration` type that has a tick period of 1 second. |
127
130
|`typedef duration<int, ratio<60>> minutes;`| Synonym for a `duration` type that has a tick period of 1 minute. |
128
131
|`typedef duration<int, ratio<3600>> hours;`| Synonym for a `duration` type that has a tick period of 1 hour. |
@@ -132,17 +135,17 @@ For more information about ratio types that are used in the following typedefs,
132
135
| Name | Description |
133
136
|--|--|
134
137
|`file_time`| A synonym for `template <class Duration> using file_time = time_point<file_clock, Duration>`. Represents a [`time_point`](time-point-class.md) for a [`file_clock`](file-clock-class.md). You specify the `Duration`. |
135
-
|`gps_seconds`| A synonym for `using gps_seconds = gps_time<seconds>;` A count of seconds, represented by a `time_point` that is associated with a [`gps_clock`](tai-clock-class.md). |
138
+
|`gps_seconds`| A synonym for `gps_time<seconds>;` A count of seconds, represented by a `time_point` that is associated with a [`gps_clock`](tai-clock-class.md). |
136
139
|`gps_time`| A synonym for `template <class Duration> using gps_time = time_point<gps_clock, Duration>`. Represents a `time_point` for a [`gps_clock`](gps-clock-class.md). You specify the `Duration`. |
137
-
|`local_days`| A synonym for `using local_days = local_time<days>`. A count of days, represented by a [`time_point`](time-point-class.md) that isn't associated with any time zone. |
140
+
|`local_days`| A synonym for `local_time<days>`. A count of days, represented by a [`time_point`](time-point-class.md) that isn't associated with any time zone. |
138
141
|`local_seconds`| A synonym for `local_time<seconds>`. Defined in `std::chrono`. |
139
-
|`local_time`| A synonym for `template <class Duration> using local_time = time_point<local_t, Duration>`. Represents a `time_point` for a local time. You specify the `Duration`. A `local_time` isn't associated with a time zone yet. It isn't the current local time of your computer's clock Only when you pair a `local_time` with a `time_zone` do you get a point in time that can be converted to UTC or other time in a specific time zone. |
140
-
|`sys_days`| A synonym for `using sys_days = sys_time<days>`. A count of days, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
141
-
|`sys_seconds`| A synonym for `using sys_seconds = sys_time<seconds>`. A count of seconds, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
142
+
|`local_time`| A synonym for `template <class Duration> using local_time = time_point<local_t, Duration>`. Represents a `time_point` for a local time. You specify the `Duration`. A `local_time` isn't associated with a time zone yet. It isn't the current local time of your computer's clock. Only when you pair a `local_time` with a `time_zone` do you get a point in time that can be converted to UTC or other time in a specific time zone. |
143
+
|`sys_days`| A synonym for `sys_time<days>`. A count of days, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
144
+
|`sys_seconds`| A synonym for `sys_time<seconds>`. A count of seconds, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
142
145
|`sys_time`| A synonym for `template <class Duration> using sys_time = time_point<system_clock, Duration>`. Represents a `time_point` for a [`system_clock`](system-clock-structure.md). You specify the `Duration`. |
143
-
|`tai_seconds`| A synonym for `using tai_seconds = tai_time<seconds>` A count of seconds, represented by a `time_point` that is associated with a [`tai_clock`](tai-clock-class.md). |
146
+
|`tai_seconds`| A synonym for `tai_time<seconds>` A count of seconds, represented by a `time_point` that is associated with a [`tai_clock`](tai-clock-class.md). |
144
147
|`tai_time`| A synonym for `template <class Duration> using tai_time = time_point<tai_clock, Duration>`. Represents a `time_point` for a [`tai_clock`](tai-clock-class.md). You specify the `Duration`. |
145
-
|`utc_seconds`| A synonym for `using utc_seconds = utc_time<seconds>;`|
148
+
|`utc_seconds`| A synonym for `utc_time<seconds>;`|
146
149
|`utc_time`| A synonym for `template<class Duration> using utc_time = time_point<utc_clock, Duration>`. Represents a `time_point`for a [`utc_clock`](utc-clock-class.md). You specify the `Duration`. |
Copy file name to clipboardExpand all lines: docs/standard-library/last-spec-struct.md
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
description: "Learn more about: last_spec struct"
3
3
title: "last_spec struct"
4
-
ms.date: 09/02/2021
4
+
ms.date: 09/15/2021
5
5
f1_keywords: ["chrono/std::chrono::last_spec"]
6
6
---
7
7
8
8
# last_spec struct
9
9
10
-
Indicates the last item in a sequence, such as the last Monday of December, the last day of the month, and so on.
10
+
Used to indicate the last item in a month, such as last day of the week of a month (the last Tuesday of February 2020) or the last day of a month (the last day of April 2019).
11
11
12
12
## Syntax
13
13
@@ -16,9 +16,12 @@ struct last_spec; // C++20
16
16
inlineconstexpr last_spec last{} // C++20
17
17
```
18
18
19
-
## Remarks
19
+
## <aname="example"></a> Example: `last`
20
20
21
-
Use this struct when creating calendrical types to indicate the last item in a sequence. When you specify `last` while creating a calendrical type like `month_day_last`, you're passing a `last_spec` to indicate that you want the last day in the month. For example:
21
+
Use `last_spec` to indicate the last item in a month. The following example uses `last` to indicate the:
22
+
- last day in December as a `monthDayLast`
23
+
- last Friday in July of 2021 as a `year_month_weekday_last`
24
+
- last day in April of 1975 as a `year_month_day_last`
22
25
23
26
```cpp
24
27
// compile using: /std:c++latest
@@ -35,13 +38,17 @@ int main()
35
38
constexpr auto yearMonthWeekDayLast{year(2021)/July/Friday[last]}; // 'last' resolves to last_spec
36
39
std::cout << yearMonthWeekDayLast << '\n';
37
40
41
+
constexpr auto yearMonthDayLast{ April / last / 1975 };
@@ -17,10 +17,17 @@ class time_zone_link; // Since C++20
17
17
18
18
## Remarks
19
19
20
-
`time_zone_link` instances are created when the time zone database is initialized. They can't be created by the developer. You can get them with `get_tzdb().links` as shown in the example at the end of this topic.
20
+
`time_zone_link` instances are created when the time zone database is initialized. They can't be created directly. Get an instance via `get_tzdb().links`, as shown in the example at the end of this topic.
21
21
22
22
Although this type has a default move constructor and move assignment operator, it isn't copyable because only `const` access is provided to this type. Using those functions results in undefined behavior, which is why the move constructor and assignment operator aren't listed here.
23
23
24
+
**Differences with IANA database**
25
+
26
+
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.
27
+
28
+
> [!NOTE]
29
+
> 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".
30
+
24
31
## Members
25
32
26
33
### Public member functions and function templates
Copy file name to clipboardExpand all lines: docs/windows/latest-supported-vc-redist.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Downloaded additional versions and languages from [Update for Visual C++ 2013 Re
54
54
### Other versions
55
55
56
56
-[Multibyte MFC Library for Visual Studio 2013](https://my.visualstudio.com/Downloads?pid=1430). This add-on for Visual Studio 2013 contains the multibyte character set (MBCS) version of the Microsoft Foundation Class (MFC) Library.
57
-
-[Visual C++ 2013 Runtime for Sideloaded Windows 8.1 apps](http://download.microsoft.com/download/5/f/0/5f0f8404-9329-44a9-8176-ed6f7f746f25/vclibs_redist_packages.zip). For more information, see [C++ Runtime for Sideloaded Windows 8.1 apps] on the [VC++ Team Blog](https://devblogs.microsoft.com/cppblog/c-runtime-for-sideloaded-windows-8-1-apps/).
57
+
-[Visual C++ 2013 Runtime for Sideloaded Windows 8.1 apps](https://download.microsoft.com/download/5/f/0/5f0f8404-9329-44a9-8176-ed6f7f746f25/vclibs_redist_packages.zip). For more information, see [C++ Runtime for Sideloaded Windows 8.1 apps] on the [VC++ Team Blog](https://devblogs.microsoft.com/cppblog/c-runtime-for-sideloaded-windows-8-1-apps/).
58
58
59
59
## Visual Studio 2012 (VC++ 11.0) Update 4
60
60
@@ -69,7 +69,7 @@ Download additional versions and languages from [Microsoft Visual C++ Redistribu
69
69
## Visual Studio 2010 (VC++ 10.0) SP1 (no longer supported)
70
70
71
71
> [!NOTE]
72
-
> Visual Studio 2010 Service Pack 1 [reached end of extended support on July 14, 2020](https://docs.microsoft.com/en-us/lifecycle/products/visual-studio-2010)
72
+
> Visual Studio 2010 Service Pack 1 [reached end of extended support on July 14, 2020](/lifecycle/products/visual-studio-2010)
@@ -84,7 +84,7 @@ Download additional languages from:
84
84
## Visual Studio 2008 (VC++ 9.0) SP1 (no longer supported)
85
85
86
86
> [!NOTE]
87
-
> Visual Studio 2008 Service Pack 1 [reached end of extended support on April 10, 2018](https://docs.microsoft.com/en-us/lifecycle/products/visual-studio-2008)
87
+
> Visual Studio 2008 Service Pack 1 [reached end of extended support on April 10, 2018](/lifecycle/products/visual-studio-2008)
0 commit comments