From Unix Date Time - CSharp System

CSharp examples for System:DateTime Unix

Description

From Unix Date Time

Demo Code

// Copyright (c)2008-2011 Mark II Software, LLC.  All Rights Reserved.
using System.Text;
using System.Collections.Generic;
using System;//from   w  w  w.  j  a  v  a  2  s  .c om

public class Main{
        public static DateTime FromUnixDateTime(this double d)
		{
			return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(d).ToLocalTime();
		}
}

Related Tutorials