[edit] Using the DateTime ToFileTime Method
The ToFileTime method converts the date to a long that represents the amount of 100 nanosecond chunks from the date January 1, 0001.
[edit] Example 1:
using System;
class Program
{
static void Main()
{
DateTime d1 = DateTime.Now;
long LongDate = d1.ToFileTime();
Console.WriteLine(LongDate.ToString());
Console.Read();
}
}
This code will take your local computer time then calculate how many 100-nanosecond chunks from January 1, 0001.
<-- DateTime Tutorial
|