C# DateTime ToOADate
Description
DateTime ToOADate
converts the value of this instance
to the equivalent OLE Automation date.
Syntax
DateTime.ToOADate
has the following syntax.
public double ToOADate()
Returns
DateTime.ToOADate
method returns A double-precision floating-point number that contains an OLE Automation
date equivalent to the value of this instance.
Example
The following example demonstrates the ToOADate method.
using System;/*from ww w . java 2s.com*/
class Sample
{
public static void Main()
{
DateTime myDateTime = new System.DateTime(2001, 5, 16, 3, 2, 15);
Console.WriteLine("Long date string: \"{0}\"\n", myDateTime.ToOADate());
}
}
The code above generates the following result.