I’ve ran up against a frustrating little issue when knocking together a page in C# and Silverlight (v5): I can’t use the DateTime.ToOADate() function! Intellisense doesn’t “see” it when typing, and if I manually type it anyway:
double OAdate()
{
double oadate= DateTime.ToOADate();
return oadate;
}
.. I’m told:
An object reference is required for the non-static field, method, or
property ‘System.DateTime.ToOADate()’
I know I’m doing something daft … but what? FromOADate() works fine.
You need to have date time object to call
ToOADatemethod.ToOADate is Convert the value of instance to the equivalent OLE Automation date. it not a static method like
DateTime.TryParsetry
or