{"id":6005,"date":"2020-10-25T06:00:27","date_gmt":"2020-10-25T06:00:27","guid":{"rendered":"https:\/\/www.modernescpp.com\/index.php\/calendar-and-time-zone-in-c-20\/"},"modified":"2023-06-26T09:38:19","modified_gmt":"2023-06-26T09:38:19","slug":"calendar-and-time-zone-in-c-20","status":"publish","type":"post","link":"https:\/\/www.modernescpp.com\/index.php\/calendar-and-time-zone-in-c-20\/","title":{"rendered":"Calendar and Time-Zones in C++20: Time of Day"},"content":{"rendered":"<p>With C++20, the <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/chrono\" target=\"_blank\" rel=\"noopener nofollow\">chrono <\/a>library from C++11 receives essential additions. The most prominent ones are calendar and time-zones support. But this is by far not all. C++20 gets new clocks, powerful formatting functionality for time durations, and a time-of-day type.<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-5945\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/07\/TimelineCpp20CoreLanguage.png\" alt=\"\" width=\"650\" height=\"278\" style=\"display: block; margin-left: auto; margin-right: auto;\" data-alt=\"TimelineCpp20CoreLanguage\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/07\/TimelineCpp20CoreLanguage.png 950w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/07\/TimelineCpp20CoreLanguage-300x128.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/07\/TimelineCpp20CoreLanguage-768x327.png 768w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>Before I dive into the extended <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/chrono\">chrono <\/a>library, particularly in this post, into the new type<span style=\"font-family: courier new, courier;\"> std::chrono::time_of_day,<\/span> I have to make a few remarks. In short, I call all date and time utilities provided by <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/chrono\">chrono<\/a> the time library.<\/p>\n<h2>The time library in C++11<\/h2>\n<p>A basic understanding of the Chrono library is essential to get the most out of this post. C++11 introduced three main components to deal with time:<\/p>\n<ul>\n<li>A<strong> time point<\/strong> is defined by a starting point, the so-called epoch, and additional time duration.<\/li>\n<li>A<strong> time duration <\/strong>is the difference between two time points. It is given by the number of ticks.<\/li>\n<li>A <strong>clock<\/strong> consists of a starting point (epoch) and a tick so that the current time point can be calculated.<\/li>\n<\/ul>\n<p>Honestly, time is for me a mysterium. On the one hand, each of us has an intuitive idea of time; conversely, defining it formally is exceptionally challenging. For example, the three components, time point, time duration, and clock depend on each other. If you want to know more about the time functionality in C++11, read my previous posts: <a href=\"https:\/\/www.modernescpp.com\/index.php\/tag\/time\">time<\/a>.<\/p>\n<\/p>\n<h2>The <code>chrono<\/code> Extensions in C++20<\/h2>\n<p>C++20 adds new components to the chrono library:<\/p>\n<ul>\n<li>The<strong> time of day<\/strong> is the duration since midnight, split into hours, minutes, seconds, and fractional seconds.<\/li>\n<li><strong>Calendar<\/strong> stands for various calendar dates such as a year, a month, a weekday, or the nth day of a week.<\/li>\n<li>A <strong>time zone<\/strong> represents a time specific to a geographic area.<\/li>\n<\/ul>\n<p>Essentially, the time-zone functionality (C++20) is based on the calendar functionality (C++20), and the calendar functionality (C++20) is based on the original chrono functionality (C++11).<\/p>\n<p>But that is not all. The extension includes new clocks. Thanks to the <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/utility\/format\">formatting library<\/a> in C++20, time durations can be read or written.<\/p>\n<h2>The <code>date<\/code> Prototype Library<\/h2>\n<p>While writing this post, no C++ compiler supports the chrono extensions in C++20 so far. Thanks to the prototype library <a href=\"https:\/\/github.com\/HowardHinnant\/date\">date&nbsp;<\/a>from Howard Hinnant, essentially a superset of the extended time functionality in C++20, I can experiment with it. The library is hosted on GitHub. There are various ways to use the <a href=\"https:\/\/github.com\/HowardHinnant\/date\">date<\/a> prototype:<\/p>\n<ol>\n<li>You can try it out on Wandbox. Howard has uploaded the <code>date.h<\/code> header sufficient to play with the new type <code>std::time_of_day<\/code> and the calendar. Here is Howard&#8217;s link: <strong><a href=\"https:\/\/wandbox.org\/permlink\/L8MwjzSSC3fXXrMd\" rel=\"nofollow\">Try it out on wandbox!<\/a><\/strong><\/li>\n<li>Copy the header&nbsp;<code>date.h<\/code>&nbsp;into the search path of your C++ compiler.<\/li>\n<li>Download the project and build it. The already mentioned GitHub page <a href=\"https:\/\/github.com\/HowardHinnant\/date\">date<\/a> gives you more information.<\/li>\n<\/ol>\n<p>I made my first steps with the online compiler Wandbox but switched to strategy 2.<\/p>\n<h3>Required C++ standard<\/h3>\n<p>In general, a C++14 compiler is sufficient to use the date library. There is one exception to this rule which I experienced with the following call:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #006699; font-weight: bold;\">auto<\/span> timeOfDay <span style=\"color: #555555;\">=<\/span> date<span style=\"color: #555555;\">::<\/span>time_of_day(<span style=\"color: #ff6600;\">10.<\/span>h <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">98<\/span>min <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">2020<\/span>s <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">0.5<\/span>s); <span style=\"color: #0099ff; font-style: italic;\">\/\/ C++20<\/span>\r\n\r\n<span style=\"color: #006699; font-weight: bold;\">auto<\/span> timeOfDay <span style=\"color: #555555;\">=<\/span> date<span style=\"color: #555555;\">::<\/span>hh_mm_ss(<span style=\"color: #ff6600;\">10.<\/span>h <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">98<\/span>min <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">2020<\/span>s <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">0.5<\/span>s);    <span style=\"color: #0099ff; font-style: italic;\">\/\/ C++17<\/span>\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>I used in my first tries the first call. The first line requires class template argument deduction for alias templates.<code> time_of_day<\/code> is an alias for <code>hh_mm_ss: using time_of_day_day = hh_mm_ss&lt;Duration&gt;. <\/code>When you now replace the alias with the class template such as in the second line (C++17), you need a C++17. Class template argument deduction is a C++17.<\/p>\n<p>Read more details about class template argument deduction here: <a href=\"https:\/\/www.modernescpp.com\/index.php\/cpp17-core\">C++17: What&#8217;s new in the Core Language?<\/a><\/p>\n<h4>Issue Solved<\/h4>\n<p>With C++20<code> time_of_day<\/code>&nbsp;was renamed to <code>hh_mm_ss. <\/code>Howard Hinnant, the creator of the date library and designer of the chrono addition, gave me a crucial hint: &#8220;<em>Prefer to use <code>hh_mm_ss<\/code> in place of <code>time_of_day<\/code>. <code>time_of_day<\/code> got renamed to <code>hh_mm_ss<\/code> during the standardization process for C++20, and so <code>time_of_day<\/code> remains strictly as a backwards-compatible shim for current and past users of this lib.<\/em>&#8220;<\/p>\n<p>This is typical Odysses you have when you are an early adopter.&nbsp;<\/p>\n<h3>Porting to C++20<\/h3>\n<p>When you only use the content of the date prototype that is part of C++20, porting it to C++ 20 is no big deal. Replace the <a href=\"https:\/\/github.com\/HowardHinnant\/date\">date&nbsp;<\/a>header files with the header file <code>&lt;chrono&gt;<\/code> and the namespace <code>date<\/code> with the namespace <code>std::chrono<\/code>:<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #009999;\">#include \"date.h\"    <\/span>\r\n<span style=\"color: #0099ff; font-style: italic;\">\/\/#include &lt;chrono&gt;<\/span>\r\n\r\n<span style=\"color: #007788; font-weight: bold;\">int<\/span> <span style=\"color: #cc00ff;\">main<\/span>() {<br \/>\r\n     <span style=\"color: #006699; font-weight: bold;\">using<\/span> <span style=\"color: #006699; font-weight: bold;\">namespace<\/span> std<span style=\"color: #555555;\">::<\/span>chrono_literals;\r\n    \r\n     <span style=\"color: #006699; font-weight: bold;\">auto<\/span> am <span style=\"color: #555555;\">=<\/span> date<span style=\"color: #555555;\">::is_am<\/span>(<span style=\"color: #ff6600;\">10<\/span>h);   \r\n     <span style=\"color: #0099ff; font-style: italic;\">\/\/ auto am = std::chrono::is_am(10h);  <\/span>\r\n\r\n} \r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Now, I write about the chrono extensions in C++20.<\/p>\n<h2>Time of Day<\/h2>\n<p><code>std::chrono::hh_mm_ss<\/code> is the duration since midnight split into hours, minutes, seconds, and fractional seconds. This type is typically used as a formatting tool. First, the following table gives you a concise overview of <code>std::chrono::hh_mm_ss<\/code> instance<code> tOfDay.<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-6003\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDayTable2.png\" alt=\"timeOfDayTable2\" width=\"550\" height=\"234\" style=\"display: block; margin-left: auto; margin-right: auto;\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDayTable2.png 1004w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDayTable2-300x128.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDayTable2-768x327.png 768w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The following program uses the functions:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f0f3f3; overflow: auto; width: auto; gray;border-width: .1em .1em .1em .8em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #0099ff; font-style: italic;\">\/\/ timeOfDay.cpp<\/span>\r\n\r\n<span style=\"color: #009999;\">#include \"date.h\"<\/span>\r\n<span style=\"color: #009999;\">#include &lt;iostream&gt;<\/span>\r\n\r\n<span style=\"color: #007788; font-weight: bold;\">int<\/span> <span style=\"color: #cc00ff;\">main<\/span>() {\r\n     <span style=\"color: #006699; font-weight: bold;\">using<\/span> <span style=\"color: #006699; font-weight: bold;\">namespace<\/span> date;                                                            <span style=\"color: #0099ff; font-style: italic;\">\/\/ (3)<\/span>\r\n     <span style=\"color: #006699; font-weight: bold;\">using<\/span> <span style=\"color: #006699; font-weight: bold;\">namespace<\/span> std<span style=\"color: #555555;\">::<\/span>chrono_literals; \r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>boolalpha <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;\r\n    \r\n     <span style=\"color: #006699; font-weight: bold;\">auto<\/span> timeOfDay <span style=\"color: #555555;\">=<\/span> date<span style=\"color: #555555;\">::<\/span>hh_mm_ss(<span style=\"color: #ff6600;\">10.5<\/span>h <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">98<\/span>min <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">2020<\/span>s <span style=\"color: #555555;\">+<\/span> <span style=\"color: #ff6600;\">0.5<\/span>s);                    <span style=\"color: #0099ff; font-style: italic;\">\/\/ (1)<\/span>\r\n    \r\n     std<span style=\"color: #555555;\">::<\/span>cout<span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay: \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;                              <span style=\"color: #0099ff; font-style: italic;\">\/\/ (2)<\/span>\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay.hours(): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay.hours() <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;             <span style=\"color: #0099ff; font-style: italic;\">\/\/ (4)<\/span>\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay.minutes(): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay.minutes() <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;         <span style=\"color: #0099ff; font-style: italic;\">\/\/ (4)<\/span>\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay.seconds(): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay.seconds() <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;         <span style=\"color: #0099ff; font-style: italic;\">\/\/ (4)<\/span>\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay.subseconds(): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay.subseconds() <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;   <span style=\"color: #0099ff; font-style: italic;\">\/\/ (4)<\/span>\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"timeOfDay.to_duration(): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> timeOfDay.to_duration() <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl; <span style=\"color: #0099ff; font-style: italic;\">\/\/ (5)<\/span>\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"date::hh_mm_ss(45700.5s): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> date<span style=\"color: #555555;\">::<\/span>hh_mm_ss(<span style=\"color: #ff6600;\">45700.5<\/span>s) <span style=\"color: #555555;\">&lt;&lt;<\/span> '\\n'<span style=\"color: #555555;\"><\/span>;  <span style=\"color: #0099ff; font-style: italic;\">\/\/ (6)<\/span>\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"date::is_am(5h): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> date<span style=\"color: #555555;\">::<\/span>is_am(<span style=\"color: #ff6600;\">5<\/span>h) <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;                 <span style=\"color: #0099ff; font-style: italic;\">\/\/ (7)<\/span>    \r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"date::is_am(15h): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> date<span style=\"color: #555555;\">::<\/span>is_am(<span style=\"color: #ff6600;\">15<\/span>h) <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;               <span style=\"color: #0099ff; font-style: italic;\">\/\/ (7)<\/span>\r\n\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;\r\n     <span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #ff6600;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #555555;\"><\/span><span style=\"color: #ff6600;\"><\/span>\r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"date::make12(5h): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> date<span style=\"color: #555555;\">::<\/span>make12(<span style=\"color: #ff6600;\">5<\/span>h) <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;               <span style=\"color: #0099ff; font-style: italic;\">\/\/ (7)<\/span>   \r\n     std<span style=\"color: #555555;\">::<\/span>cout <span style=\"color: #555555;\">&lt;&lt;<\/span> <span style=\"color: #cc3300;\">\"date::make12(15h): \"<\/span> <span style=\"color: #555555;\">&lt;&lt;<\/span> date<span style=\"color: #555555;\">::<\/span>make12(<span style=\"color: #ff6600;\">15<\/span>h) <span style=\"color: #555555;\">&lt;&lt;<\/span> std<span style=\"color: #555555;\">::<\/span>endl;             <span style=\"color: #0099ff; font-style: italic;\">\/\/ (7)<\/span> \r\n\r\n}\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>In line (1), I create a new instance of std::chrono::hh_mm_ss: <code>timeOfDay<\/code>. Thanks to the chrono literals from C++14, I can add a few time durations to initialize a time-of-day object. With C++20, you can directly output<code> timeOfDay<\/code> (line 2). This is the reason I have to introduce the namespace <code>date<\/code> in line 3. The rest should be straightforward to read. Lines (4) display the components of the time since midnight in hours, minutes, seconds, and fractional seconds. Line (5) returns the time duration since midnight in seconds. Line (6) is more interesting: the given seconds correspond to the time displayed in line (2). Line (7) returns if the given hour is a.m. Line (8) finally returns the 12-hour equivalent of the given hour.<\/p>\n<p>Thanks to the <a href=\"https:\/\/github.com\/HowardHinnant\/date\">date<\/a> library, here is the output of the program:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-6004\" src=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDay2.png\" alt=\"timeOfDay2\" width=\"440\" height=\"376\" style=\"display: block; margin-left: auto; margin-right: auto;\" srcset=\"https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDay2.png 1376w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDay2-300x257.png 300w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDay2-1024x876.png 1024w, https:\/\/www.modernescpp.com\/wp-content\/uploads\/2020\/10\/timeOfDay2-768x657.png 768w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/p>\n<h2>What&#8217;s next?<\/h2>\n<p>My <a href=\"https:\/\/www.modernescpp.com\/index.php\/calendar-and-time-zone-in-c-20-working-with-calendar-dates\">next post<\/a> presents the next component of the extended chrono library: the calendar.<\/p>\n<p>&nbsp;<\/p>\n<\/p>\n<div id=\"simple-translate\">&nbsp;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>With C++20, the chrono library from C++11 receives essential additions. The most prominent ones are calendar and time-zones support. But this is by far not all. C++20 gets new clocks, powerful formatting functionality for time durations, and a time-of-day type.<\/p>\n","protected":false},"author":21,"featured_media":5945,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[375],"tags":[453],"class_list":["post-6005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-20","tag-time"],"_links":{"self":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/6005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/comments?post=6005"}],"version-history":[{"count":2,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/6005\/revisions"}],"predecessor-version":[{"id":9314,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/posts\/6005\/revisions\/9314"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media\/5945"}],"wp:attachment":[{"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/media?parent=6005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/categories?post=6005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modernescpp.com\/index.php\/wp-json\/wp\/v2\/tags?post=6005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}