R
Roy
I want to copy a DateTime value to/from an byte[] array. However, when I try
to get the size of DateTime by using sizeof(DateTime), the compiler complains:
'System.DateTime' does not have a predefined size, therefore sizeof can only
be used in an unsafe context (consider using
System.Runtime.InteropServices.Marshal.SizeOf)
Why I cannot get the size just like other integer values? How do I convert a
DateTime to/from byte[]? I have no problem to do it for other types like
short...
to get the size of DateTime by using sizeof(DateTime), the compiler complains:
'System.DateTime' does not have a predefined size, therefore sizeof can only
be used in an unsafe context (consider using
System.Runtime.InteropServices.Marshal.SizeOf)
Why I cannot get the size just like other integer values? How do I convert a
DateTime to/from byte[]? I have no problem to do it for other types like
short...