convert unix timestamp to sql date time c# code example
Example 1: sql convert unix time to date
select FROM_UNIXTIME(UNIX_TIMESTAMP(),'%a %b %d %H:%i:%s UTC %Y');
Example 2: c# convert datetime to unix timestamp
Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;