get Current Time Ticks - CSharp System

CSharp examples for System:DateTime Timestamp

Description

get Current Time Ticks

Demo Code


using windows_client.Languages;
using System.Text;
using System;/*from   w  w  w  .j ava  2  s  .  c  om*/

public class Main{
        public static long getCurrentTimeTicks()
        {
            long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
            ticks /= 10000; //presicion increased to avoid conflicts in timestamps of failed messages
            return ticks;
        }
}

Related Tutorials