get Current Time Stamp - CSharp System

CSharp examples for System:DateTime Timestamp

Description

get Current Time Stamp

Demo Code


using windows_client.Languages;
using System.Text;
using System;/*w ww .  jav  a2  s . c  o m*/

public class Main{
        public static long getCurrentTimeStamp()
        {
            long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
            ticks /= 10000000; //Convert windows ticks to seconds
            return ticks;
        }
}

Related Tutorials