Skip to content

Commit b1c2049

Browse files
TaojunshenColin RobertsonTylerMSFTopbld15TylerMSFT
authored
8/23/2021 AM Publish (#3732)
* draft * fix code sample (#3676) * fix code sample * acrolinx Co-authored-by: TylerMSFT <[email protected]> * document clocks * add tai-clock * Address 3269 typo in warning number (#3680) * Fixed typo: evalution --> evaluation * updates * finish draft of new clocks * acrolinx * Fixed typo: evalution --> evaluation * Bulk Fix - Sentence form for all alt text (#3683) * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Updated C/C++ workload name The workload for C/C++ development in VS Build Tools 2019 installer is called 'Desktop development with C++'. * Split out docs by version Add VS2017-specific instructions. * Add 16.11 Compiler Warnings C5247 and C5248 (MicrosoftDocs#3689) * Add C5247 and C5248 * Fix link typos * Updates per Xiang Fan review * More wordsmithage * More fix per X.F. * Fix inconsistencies in CMake docs (MicrosoftDocs#3692) * Standard format for CMake docs * Fix markdownlint * More cleanup. * Clean up link issue, acrolinx * Fix more broken things * Undo a change * Add documentation for "unspecified" architecture Add documentation regarding "unspecified" architecture such that it provides an option for someone to ensure that no inherited environment is selected. * Update markdownlint.json file for unordered lists (#3694) Block rule that wants * instead of - to prefix unordered lists, since we've standardized on the latter. Merging on my own recognizance as repo admin. * Clean up documentation for "unspecified" architecture * Markdown quality fixes 1 of N * Markdown quality fixes 2 of N * Markdown quality fixes 3 of N * Markdown quality fixes 4 of N * Markdown quality fixes 5 of N * Markdown quality fixes 6 of N * Markdown quality fixes 7 of N * Markdown quality fixes 8 of N * Markdown quality fixes 9 of N * Markdown quality fixes 10 of N * Undo TN038 * Markdown quality fixes 11 of N * Setting PATH allows DUMPBIN to be executed from the system command prompt. There are multiple DUMPBIN.EXE's in the MSVC folder, but they can be executed if the PATH is set correctly. If this is not true, or undesireable per system design constraints, please clarify otherwise. * Call out toolchains and embedded scenarios * Add link to environment setting instructions * Make more readable * Address cpp-docs 3286 Postfix increment, decrement syntax (MicrosoftDocs#3711) * Address cpp-docs issue 3286 * Fix formatting, final example * Add compiler warning C5243, C5249, C5250 (MicrosoftDocs#3710) * Removing linux and non-windows bullet point * Make clear it's not required to meet all conditions Add "or" to final bullet point * PR review edit, Microsoft style for lists * Make the "unspecified" architecture option more general * Add __SANITIZE_ADDRESS__ to predefined macros page Noticed __SANITIZE_ADDRESS__ was missing from this list. * Add VS version Also note the VS version where __SANITIZE_ADDRESS__ was added in. * Add docs on using existing cache without cmake-server * Fix unescaped <chrono> (MicrosoftDocs#3715) Noticed this while doing other changes. Without being in a code block, <chrono> becomes the html element of the same name. * Address issue 3301 * Create and integrate /Zc:lambda article (#3719) * Create and integrate /Zc:lambda article * Fix conformance topic date * First half of C++20 changes * The other half of the /std:c++20 fixes * Fix link * Update cmake-projects-in-visual-studio.md * Remove duplicate line in build TOC * tech review * fixes * Cleanup per review * updates per tech review and other * added file_clock * add gps_clock * update metadata * finished draft for local_t * acrolinx * incorp tech review * update typedef sections * add all related typedefs * fix tables * acrolinx * cleanup * fix links * fix tables * more table cleanup * another fix for tables. error msgs aren't by the error but I think I finally found the issue * one more table fix * typos Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: ystamant <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: Andrew Shymanel <[email protected]> Co-authored-by: Garrett Campbell <[email protected]> Co-authored-by: PRMerger6 <[email protected]> Co-authored-by: PRMerger12 <[email protected]> Co-authored-by: PRMerger14 <[email protected]> Co-authored-by: PRMerger16 <[email protected]> Co-authored-by: PRMerger15 <[email protected]> Co-authored-by: PRMerger7 <[email protected]> Co-authored-by: PRMerger10 <[email protected]> Co-authored-by: David Dyck <[email protected]> Co-authored-by: Kristine Toliver <[email protected]> Co-authored-by: Steve Wishnousky <[email protected]> Co-authored-by: Sam Freed <[email protected]> Co-authored-by: Don Spencer <[email protected]> Co-authored-by: Beau Braig <[email protected]> Co-authored-by: Paula Miller <[email protected]>
1 parent a5eeabc commit b1c2049

20 files changed

+1584
-833
lines changed

docs/standard-library/chrono-functions.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: &lt;chrono&gt; functions"
33
title: "&lt;chrono&gt; functions"
4-
ms.date: 6/16/2021
4+
ms.date: "08/13/2021"
55
f1_keywords: ["chrono/std::duration_cast", "chrono/std::time_point_cast", "chrono/std::chrono::duration_cast", "chrono/std::chrono::time_point_cast", "chrono/std::chrono::from_stream", "chrono/std::chrono::floor", "chrono/std::chrono::ceil", "chrono/std::chrono::round", "chrono/std::chrono::is_am", "chrono/std::chrono::is_pm", "chrono/std::chrono::make12", "chrono/std::chrono::make24", "chrono/std::chrono::get_leap_second_info", "chrono/std::chrono::get_tzdb", "chrono/std::chrono::get_tzdb_list", "chrono/std::chrono::locate_zone", "chrono/std::chrono::current_zone", "chrono/std::chrono::reload_tzdb", "chrono/std::chrono::remote_version"]
66
helpviewer_keywords: ["std::duration_cast function", "std::time_point_cast function", "std::chrono::duration_cast function", "std::chrono::time_point_cast function", "std::chrono::from_stream function", "std::chrono::floor function", "std::chrono::ceil function", "std::chrono::round function", "std::chrono::is_am function", "std::chrono::is_pm function", "std::chrono::make12 function", "std::chrono::make24 function", "std::chrono::get_leap_second_info function", "std::chrono::get_tzdb function", "std::chrono::get_tzdb_list function", "std::chrono::locate_zone function", "std::chrono::current_zone function", "std::chrono::reload_tzdb function", "std::chrono::remote_version function"]
77
---
@@ -352,13 +352,13 @@ The format string used to match the input. See [Parse format strings](#parse-for
352352
The `file_time` parsed from the stream.
353353

354354
*`gt`*\
355-
The `gps_time` parsed from the stream.
355+
The [`gps_time`](chrono.md#typedefs) parsed from the stream.
356356

357357
*`is`*\
358358
The input stream to parse.
359359

360360
*`lt`*\
361-
The `local_time` parsed from the stream.
361+
The [`local_time`](chrono.md#typedefs) parsed from the stream.
362362

363363
*`m`*\
364364
The `month` parsed from the stream.
@@ -370,13 +370,13 @@ The `month_day` parsed from the stream.
370370
If *`offset`* isn't `nullptr`, and the format specifier `%z` or modified variant such as `%Ez` or `%0z` is specified, and the parse is successful, then *`offset`* points to the parsed value.
371371

372372
*`st`*\
373-
The `system_time` parsed from the stream.
373+
The [`sys_time`](chrono.md#typedefs) parsed from the stream.
374374

375375
*`tt`*\
376-
The `tai_time` parsed from the stream.
376+
The [`tai_time`](chrono.md#typedefs) parsed from the stream.
377377

378378
*`ut`*\
379-
The `utc_time` parsed from the stream.
379+
The [`utc_time`](chrono.md#typedefs) parsed from the stream.
380380

381381
*`wd`*\
382382
The `weekday` parsed from the stream.
@@ -538,12 +538,11 @@ In ISO 8601, weeks begin with Monday. The first week of the year must include Ja
538538
| `year_month_weekday_last` | D, F, g, G, j, U, V, W, Y, y, C, b, h, B, m, d, e, a, A, u, w |
539539
| `zoned_time` | z, Z, c, x, X, D, F, Y, C, y, b, B, h, m, d, e, a, A, u, w, H, I, M, S, r, R, T, p, g, G, U, V, W |
540540

541-
<a name="notice"></a><sup>1</sup>The implementation is currently consistent with [strftime](../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md) in that although `O` (letter O) and `e` are accepted, they are ignored. That is, `"%Od"` is interpreted as `"%d"`.
541+
<a name="notice"></a><sup>1</sup>The implementation is currently consistent with [strftime](../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md) in that although `O` (letter O) and `e` are accepted, they're ignored. That is, `"%Od"` is interpreted as `"%d"`.
542542

543543
## <a name="std-chrono-get-leap-second-info"></a> `get_leap_second_info`
544544

545-
Returns a [`leap_second_info`](./leap-second-info-struct.md)\
546-
for the specified time.
545+
Returns a [`leap_second_info`](./leap-second-info-struct.md) for the specified time. This provides info about whether the supplied time occurs during a leap second insertion. It also provides the number of leap seconds that have been added between January 1, 1970 and the specified time. A leap second insertion occurs when the International Earth Rotation and Reference Systems Service (IERS) declares that a leap second will be added (resulting in a 61 second minute) to account for the difference between atomic time and time tracked by measuring the rotation of the earth, which is irregular, and is gradually slowing.
547546

548547
### Syntax
549548

docs/standard-library/chrono-operators.md

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: "Learn more about: &lt;chrono&gt; operators"
33
title: "&lt;chrono&gt; operators"
4-
ms.date: "6/30/2021"
5-
f1_keywords: ["chrono/std::operator modulo", "chrono/std::operator+", "chrono/std::chrono::day::operator+", "chrono/std::chrono::duration::operator+", "chrono/std::chrono::month::operator+", "chrono/std::chrono::time_point::operator+", "chrono/std::chrono::weekday::operator+", "chrono/std::chrono::year_month::operator+", "chrono/std::chrono::year::operator+", "chrono/std::chrono::year_month_day::operator+", "chrono/std::chrono::year_month_day_last::operator+", "chrono/std::chrono::year_month_weekday::operator+", "chrono/std::chrono::year_month_weekday_last::operator+", "chrono/std::operator!=", "chrono/std::operator*", "chrono/std::operator/", "chrono/std::operator-", "chrono/std::operator<", "chrono/std::operator<=", "chrono/std::operator<", "chrono/std::operator==", "chrono/std::operator>>", "chrono/std::operator<=>", "chrono/std::chrono::day::operator<=>", "chrono/std::chrono::month::operator<=>", "chrono/std::chrono::year::operator<=>", "chrono/std::chrono::year_month::operator<=>", "chrono/std::chrono::time_point::operator<=>", "chrono/std::chrono::duration::operator<=>", "chrono/std::chrono::month_day_last::operator<=>", "chrono/std::chrono::year_month_day_last::operator<=>", "chrono/std::operator==", "chrono/std::chrono::year::operator<==>", "chrono/std::chrono::day::operator==", "chrono/std::chrono::duration::operator==", "chrono/std::chrono::month::operator==", "chrono/std::chrono::month_day::operator==", "chrono/std::chrono::month_day_last::operator==", "chrono/std::chrono::month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::time_point::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year_month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::weekday_last::operator==", "chrono/std::chrono::year_month_weekday_indexed::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::operator-", "chrono/std::chrono::day::operator-", "chrono/std::chrono::duration::operator-", "chrono/std::chrono::month::operator-", "chrono/std::chrono::time_point::operator-", "chrono/std::chrono::weekday::operator-", "chrono/std::chrono::year_month::operator-", "chrono/std::chrono::year::operator-", "chrono/std::chrono::year_month_day::operator-", "chrono/std::chrono::year_month_day_last::operator-", "chrono/std::chrono::year_month_weekday::operator-", "chrono/std::chrono::year_month_weekday_last::operator-", "chrono/std::chrono::day::operator<<", "chrono/std::chrono::hh_mm_ss::operator<<", "chrono/std::chrono::month_day::operator<<", "chrono/std::chrono::month_day_last::operator<<", "chrono/std::chrono::month_weekday::operator<<", "chrono/std::chrono::month_weekday_last::operator<<", "chrono/std::chrono::weekday::operator<<", "chrono/std::chrono::weekday_indexed::operator<<", "chrono/std::chrono::weekday_last::operator<<", "chrono/std::chrono::year::operator<<", "chrono/std::chrono::year_month_day::operator<<", "chrono/std::chrono::year_month_day_last::operator<<", "chrono/std::chrono::year_month_weekday::operator<<"]
4+
ms.date: "08/13/2021"
5+
f1_keywords: ["chrono/std::operator modulo", "chrono/std::operator+", "chrono/std::chrono::day::operator+", "chrono/std::chrono::duration::operator+", "chrono/std::chrono::month::operator+", "chrono/std::chrono::time_point::operator+", "chrono/std::chrono::weekday::operator+", "chrono/std::chrono::year_month::operator+", "chrono/std::chrono::year::operator+", "chrono/std::chrono::year_month_day::operator+", "chrono/std::chrono::year_month_day_last::operator+", "chrono/std::chrono::year_month_weekday::operator+", "chrono/std::chrono::year_month_weekday_last::operator+", "chrono/std::operator!=", "chrono/std::operator*", "chrono/std::operator/", "chrono/std::operator-", "chrono/std::operator<", "chrono/std::operator<=", "chrono/std::operator<", "chrono/std::operator==", "chrono/std::operator>>", "chrono/std::operator<=>", "chrono/std::chrono::day::operator<=>", "chrono/std::chrono::month::operator<=>", "chrono/std::chrono::year::operator<=>", "chrono/std::chrono::year_month::operator<=>", "chrono/std::chrono::time_point::operator<=>", "chrono/std::chrono::duration::operator<=>", "chrono/std::chrono::month_day_last::operator<=>", "chrono/std::chrono::year_month_day_last::operator<=>", "chrono/std::operator==", "chrono/std::chrono::year::operator<==>", "chrono/std::chrono::day::operator==", "chrono/std::chrono::duration::operator==", "chrono/std::chrono::month::operator==", "chrono/std::chrono::month_day::operator==", "chrono/std::chrono::month_day_last::operator==", "chrono/std::chrono::month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::time_point::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year_month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::weekday_last::operator==", "chrono/std::chrono::year_month_weekday_indexed::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::operator-", "chrono/std::chrono::day::operator-", "chrono/std::chrono::duration::operator-", "chrono/std::chrono::month::operator-", "chrono/std::chrono::time_point::operator-", "chrono/std::chrono::weekday::operator-", "chrono/std::chrono::year_month::operator-", "chrono/std::chrono::year::operator-", "chrono/std::chrono::year_month_day::operator-", "chrono/std::chrono::year_month_day_last::operator-", "chrono/std::chrono::year_month_weekday::operator-", "chrono/std::chrono::year_month_weekday_last::operator-", "chrono/std::chrono::day::operator<<", "chrono/std::chrono::hh_mm_ss::operator<<", "chrono/std::chrono::month_day::operator<<", "chrono/std::chrono::month_day_last::operator<<", "chrono/std::chrono::month_weekday::operator<<", "chrono/std::chrono::month_weekday_last::operator<<", "chrono/std::chrono::weekday::operator<<", "chrono/std::chrono::weekday_indexed::operator<<", "chrono/std::chrono::weekday_last::operator<<", "chrono/std::chrono::year::operator<<", "chrono/std::chrono::year_month_day::operator<<", "chrono/std::chrono::year_month_day_last::operator<<", "chrono/std::chrono::year_month_weekday::operator<<", "chrono/std::chrono::utc_time::operator<<", "chrono/std::chrono::tai_time::operator<<", "chrono/std::chrono::gps_time::operator<<", "chrono/std::chrono::local_time::operator<<", "chrono/std::chrono::file_time::operator<<"]
66
---
77
# `<chrono>` operators
88

@@ -131,7 +131,7 @@ constexpr year_month_weekday_last operator+(const years& dy, const year_month_we
131131
132132
16\) Returns `(ymwdl.year() / ymwdl.month() + dm) / ymwdl.weekday_last()`. Note: The `/` used here is not a division operator but the date operator.
133133
134-
17\) Returns Returns: `ymwdl + dy`
134+
17\) Returns: `ymwdl + dy`
135135
136136
### Example: `operator+`
137137
@@ -804,12 +804,17 @@ true true false
804804
Output the following types to a stream:
805805

806806
- [`day`](day-class.md)
807+
- [`file_time`](chrono.md)
808+
- [`gps_time`](gps-clock-class.md)
807809
- [`hh_mm_ss`](hhmmss-class.md)
810+
- [`local_time`](local_t.md)
808811
- [`month`](month-class.md)
809812
- [`month_day`](month-day-class.md)
810813
- [`month_day_last`](month-day-last-class.md)
811814
- [`month_weekday`](month-weekday-class.md)
812815
- [`month_weekday_last`](month-weekday-last-class.md)
816+
- [`tai_time`](tai-clock-class.md)
817+
- [`utc_time`](utc-clock-class.md)
813818
- [`weekday`](weekday-class.md)
814819
- [`weekday_indexed`](weekdayindexed-class.md)
815820
- [`weekday_last`](weekdaylast-class.md)
@@ -899,7 +904,27 @@ operator<<(basic_ostream<CharT, Traits>& os, const year_month_weekday& ymwd); //
899904
// 16) year_month_weekday_last
900905
template<class CharT, class Traits>
901906
basic_ostream<CharT, Traits>&
902-
operator<<(basic_ostream<CharT, Traits>& os, const year_month_weekday_last& ymwdl);
907+
operator<<(basic_ostream<CharT, Traits>& os, const year_month_weekday_last& ymwdl); // C++ 20
908+
909+
// 17) tai_time
910+
template<class CharT, class Traits, class Duration>
911+
basic_ostream<CharT, Traits>&
912+
operator<<(basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t); // C++ 20
913+
914+
// 18) utc_time
915+
template<class CharT, class Traits, class Duration>
916+
basic_ostream<CharT, traits>&
917+
operator<<(basic_ostream<CharT, Traits>& os, const utc_time<Duration>& t); // C++ 20
918+
919+
// 19) gps_time
920+
template<class CharT, class Traits, class Duration>
921+
basic_ostream<CharT, Traits>&
922+
operator<<(basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t); // C++ 20
923+
924+
// 20) local_time
925+
template<class CharT, class Traits, class Duration>
926+
basic_ostream<CharT, Traits>&
927+
operator<<(basic_ostream<CharT, Traits>& os, const local_time<Duration>& t); // C++ 20
903928
```
904929
905930
### Parameters
@@ -934,6 +959,9 @@ The `month_weekday` to output.
934959
*`mwdl`*\
935960
The `month_weekday_last` to output.
936961
962+
*`t`*\
963+
The `local_time`, `gps_time`, `tai_time`, or `utc_time` to output.
964+
937965
*`wd`*\
938966
The `weekday` to output.
939967
@@ -969,7 +997,7 @@ The output stream you passed in, `os`
969997
970998
1\) The `day` value is output as a decimal number, with a leading zero if the result would be a single digit. If `!d.ok()`, then " isn't a valid day" is appended to the output.
971999
972-
2\) The `hh_mm_ss` value is output as hours:minutes:seconds:thousands of seconds. For example, `"00:00:05.721`"
1000+
2\) The `hh_mm_ss` value is output as hours:minutes:seconds:thousandths of seconds. For example, `"00:00:05.721`"
9731001
9741002
3\) The abbreviated month name, using the locale associated with `os`, is output. For example, `Jan`. If `!m.ok()`, then `" is not a valid month"` is appended to the output.
9751003
@@ -999,6 +1027,38 @@ The output stream you passed in, `os`
9991027
10001028
16\) The `year_month_weekday_last` is output in the form yyyy/month/weekday[last]. For example, `1996/Jan/Wed[last]`
10011029
1030+
17\) The `tai_time` is output in the form yyyy-mm-dd hh:mm:ss.sssssss. For example, `2021-08-13 23:23:08.4358666`
1031+
1032+
18\) The `utc_time` is output in the form yyyy-mm-dd hh:mm:ss.sssssss. For example, `2021-08-13 23:23:08.4358666`
1033+
1034+
19\) The `gps_time` is output in the form yyyy-mm-dd hh:mm:ss.sssssss. For example, `2021-08-13 23:23:08.4358666`
1035+
1036+
20\) The `local_time` is output as the number of seconds since the clock's epoch. It's output as though by `os << std::chrono::sys_time<Duration>(some_local_time.time_since_epoch());`. For example, if `some_local_time` is August 18, 2021 3:13pm, the output is `1597792380`.
1037+
1038+
### Example: `operator<<`
1039+
1040+
```cpp
1041+
// compile using: /std:c++latest
1042+
#include <iostream>
1043+
#include <chrono>
1044+
1045+
using namespace std::chrono;
1046+
1047+
int main()
1048+
{
1049+
std::cout << utc_clock::now() << '\n';
1050+
1051+
year_month ym{ 2021y / April };
1052+
std::cout << ym;
1053+
return 0;
1054+
}
1055+
```
1056+
1057+
```output
1058+
2021-08-16 20:47:05.6299822
1059+
2021/Apr
1060+
```
1061+
10021062
## <a name="op_modulo"></a> `operator modulo`
10031063

10041064
Operator for modulo operations on [`duration`](../standard-library/duration-class.md) objects.

0 commit comments

Comments
 (0)