title: Convert OLE Automation Date (OADate) double to struct tm without using VariantTimeToSystemTime
body: <p>I'm writing a Windows DLL in mostly std C++ (VS2010), which does not use MFC/ATL. </p>
  
  <p>A parent module does use MFC and passes a <code>COleDateTime.m_dt</code> to my DLL, which arrives as a <code>double</code>. I believe this is an OLE Automation Date, also known as OADate.</p>
  
  <p>I want to convert this to any type of standard struct (tm...) that has days, hours, etc without pulling MFC, OLE, etc into my DLL.</p>
  
  <p>This has been asked before (<a href="https://stackoverflow.com/questions/4586812/convert-date-time-as-double-to-struct-tm-in-c">Convert Date/Time (as Double) to struct* tm in C++</a>) however, the answer is always using <code>VariantTimeToSystemTime()</code>, which misses the point of that question - not using MFC / OLE, etc.  </p>
  
  <p>VariantTimeToSystemTime's requirements are:</p>
  
  <p>Header - OleAuto.h<br>
  Library - OleAut32.lib<br>
  DLL - OleAut32.dll</p>
  
  <p>My DLL has basically no dependencies at the moment, so I would prefer not to pull OleAut32.dll in for this one conversion.</p>
  
  <p>The best thing I've found so far has been this <a href="https://gist.github.com/atifaziz/6b69b87c69ee31166ffe53da3f3fcbb3" rel="nofollow noreferrer">C# mono code</a>, which I may convert to C++.</p>