title: How to convert C date string into an integer?
body: <p>I have dates as strings in this format:</p>
  <pre><code>YYYY-MM-DD (2021-07-01, 2021-02-21 etc.)
  </code></pre>
  <p>Now I want to compare them, and the best solution I can think of is converting all of those dates into some number (like unix time), but I don't know how to do it.</p>
  <p>It has to be precise with days (so that 2021-01-01 &lt; 2021-01-02).</p>
  <p>I found strptime() function on the Internet, but I'm a Windows user (CLion), so I can't use that.</p>
  <p>Is it possible to do it in a simple way? Leap years have to accounted for.</p>
  <p>EDIT:
  My input data look like this:</p>
  <pre><code>char date1[] = &quot;2021-01-07&quot;;
  char date2[] = &quot;2021-01-14&quot;;
  char date3[] = &quot;2021-01-20&quot;; etc.
  </code></pre>
  <p>How I want to use them:</p>
  <pre><code>if (date1 &lt; date2 &lt; date3){
      // return &quot;true&quot; if date2 is in the interval (Pseudocode ofc)
      return true;
  }
  </code></pre>