title: C++ namespace "std" has no member "format" despite #include <format>
body: <p>I am new to C++. I am trying to store the current date and time as a string variable.</p>
  <p>At <a href="https://stackoverflow.com/questions/48217017/">this question</a>, I found an answer, and installed the <code>date.h</code> library.</p>
  <p>However, when I try to use the code provided, I am met with the error:</p>
  <blockquote>
  <p>namespace &quot;std&quot; has no member &quot;format&quot;</p>
  </blockquote>
  <p>Despite having <code>#include &lt;format&gt;</code> at the top of the script.</p>
  <p>How can I fix this?</p>
  <p>I am using Visual Studio 2022 on Windows 10, if that helps.</p>
  <p>Here is my code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;chrono&gt;
  #include &lt;date.h&gt;
  #include &lt;type_traits&gt;
  #include &lt;format&gt;
  
  
  int main()
  {
      std::cout &lt;&lt; &quot;The current time is &quot;;
      auto start_time = std::format(&quot;{:%F %T}&quot;, std::chrono::system_clock::now());
      static_assert(std::is_same_v&lt;decltype(start_time), std::string&gt;{});
      std::cout &lt;&lt; start_time &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>