Get Epoch seconds - CSharp System

CSharp examples for System:DateTime Second

Description

Get Epoch seconds

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;// w  ww  . ja  v  a  2  s.  c o  m

public class Main{
        public static uint GetEpoch()
        {
            return (uint)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds;
        }
}

Related Tutorials