c# 4.0 - How to Convert unix Timestamp in nanoseconds to DateTime in C# -
i have c# wpf user interface , c end. i'm receiving unix timestamp in nanoseconds end. there way convert nanoseconds human readable format?
try
public static datetime unixtimestamptodatetime( double unixtimestamp ) { // unix timestamp seconds past epoch system.datetime dtdatetime = new datetime(1970,1,1,0,0,0,0,system.datetimekind.utc); dtdatetime = dtdatetime.addseconds( unixtimestamp ).tolocaltime(); return dtdatetime; }
Comments
Post a Comment