datedatetimewindows-8olewindows-rt

Windows 8 RT DateTime.FromOADate


Recently started porting an application from Windows Phone 8 to Windows 8 RT, and faced strange problem: can't find a way to convert DateTime structure to double OLE date.

Earlier, there were methods DateTime.FromOADate and DateTime.ToOADate to do this, but now they are not available.

...
double oaNow = System.DateTime.Now.ToOADate();  //ToOADate undefined
...

What can be wrong?


Solution

  • For whatever reason this was not included in the RT targets. It doesn't do anything particularly special, it it appears it could be portable.

    You can probably duplicate the functionality in your own method by looking at the Reference source for the .NET Framework.