Mega Code Archive
Gets the number of ticks from DateTimeOffset
using System;
using System.Globalization;
public class Test
{
public static void Main()
{
const long NSPerSecond = 10000000;
long ticks;
ticks = 7 * NSPerSecond; // Ticks in a 7 seconds
DateTimeOffset dto = new DateTimeOffset(ticks,DateTimeOffset.Now.Offset);
Console.WriteLine("There are {0:n0} ticks in {1}.", dto.Ticks, dto.ToString());
}
}