Q: Convert DateTime to ticks in .NET? How to convert one DateTime to ticks? 

A: By using the Ticks property:
DateTime now = DateTime.Now;
long ticks = now.Ticks;


A: static long ConvertDateTimeToTicks(DateTime datetime)
    {
       long  ticks=datetime.Ticks;
       return ticks;
    } 

  static DateTime ConvertTicksToDateTime(long ticks)
    {
       DateTime datetime= new DateTime(ticks);
       return datetime;
    }

