title: Subtract DateOnly in C#
body: <p>In C# I can't use subtraction with <code>DateOnly</code> variables, unlike <code>DateTime</code>. Is there any explanation?</p>
  <pre><code>  var a = new DateTime(2000, 01, 01);
    var b = new DateTime(1999, 01, 01);
  
    //var c = a.Subtract(b);
    var c = a - b;
  
    var d = new DateOnly(2000, 01, 01);
    var e = new DateOnly(1999, 01, 01);
  
    var f = d - e; // Error - Operator '-' cannot be applied to operands of type 'DateOnly' and 'DateOnly'
  </code></pre>