title: What is the average size of a DateTimeOffset on a x64 bit Azure machine?
body: <p>I've been trying to get the size of a <a href="https://msdn.microsoft.com/en-us/library/system.datetimeoffset(v=vs.110).aspx" rel="nofollow"><code>DateTimeOffset</code></a> struct in my code so that I can compute the size of a parent object.   The problem is that neither the <a href="https://msdn.microsoft.com/en-us/library/eahchzkf.aspx" rel="nofollow"><strong><code>sizeof</code></strong></a> operator nor the <a href="https://msdn.microsoft.com/en-us/library/5s4920fa(v=vs.110).aspx" rel="nofollow"><code>Marshal.SizeOf</code></a> function work for this purpose.</p>
  
  <p>sizeof won't work because I have to compile with the unsafe flag, and this feature isn't enough of a justification to do that.   Marshal.SizeOf throws an exception:</p>
  
  <blockquote>
    <p>Type 'System.DateTimeOffset' cannot be marshaled as an unmanaged
    structure; no meaningful size or offset can be computed.</p>
  </blockquote>
  
  <p>I've given up on trying to calculate the size of a struct like this, because every line of attack/blog post comes up with one error or another.</p>
  
  <p>Can someone just tell me what the average size of a DateTimeOffset is on a 64 bit Azure web server is?</p>