Convert DateTimeOffset From Js Timestamp - CSharp System

CSharp examples for System:DateTime Timestamp

Description

Convert DateTimeOffset From Js Timestamp

Demo Code

// License:    New BSD License (BSD)

public class Main{
        public static DateTimeOffset ConvertFromJsTimestamp(long timestamp)
		{/*from ww w.ja va 2 s  .  c om*/
			DateTimeOffset origin = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, DateTimeOffset.Now.Offset);
			return origin.AddMilliseconds(timestamp);
		}
}

Related Tutorials