Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# convert Unix time in seconds to datetime

public static DateTime UnixTimeStampToDateTime( double unixTimeStamp )
{
    // Unix timestamp is 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;
}
Comment

c# convert datetime to unix timestamp

Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# copy to clipboard 
Csharp :: stream to byte array c# 
Csharp :: c# set a guid 
Csharp :: c# random boolean 
Csharp :: init dictionary c# 
Csharp :: decimal in .asp.net core 
Csharp :: c# list string initialize inline 
Csharp :: isletter c# 
Csharp :: unity get current scene 
Csharp :: wait in unity 
Csharp :: c# log to console 
Csharp :: c# long to int 
Csharp :: how to change scenes with button press in unity c# 
Csharp :: unity serializefield 
Csharp :: radians to degree c# 
Csharp :: unity smooth camera 2d 
Csharp :: c# convert string to char array 
Csharp :: custom editor unity 
Csharp :: c# quit 
Csharp :: c# download file 
Csharp :: c# socket receive 
Csharp :: minheap c# 
Csharp :: change image source wpf 
Csharp :: InvalidOperationException: Calling Scene Raisefrom assembly reloading callbacks are not supported. 
Csharp :: c# datagridview color header 
Csharp :: unity camera follow 
Csharp :: set decimal point c# 
Csharp :: unity bullet script 
Csharp :: remove all letters from string c# 
Csharp :: .net: setting max size for sql parameter 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =