Assets/Watson/Scripts/Utilities/Utility.cs
/// <summary>
/// Gets the date time from epoch.
/// </summary>
/// <returns>The date time from epoch.</returns>
/// <param name="epochTime">Epoch time.</param>
/// <param name="kind">Kind.</param>
Gets the date time from epoch.
Gets the date time from epoch .
public static DateTime GetLocalDateTimeFromEpoch(double epochTime)
        {
            DateTime dateTime = new DateTime(1970,1,1,0,0,0,0,System.DateTimeKind.Utc);
            try
            {
                dateTime = dateTime.AddSeconds(epochTime).ToLocalTime();
            }
            catch (ArgumentOutOfRangeException ex)
            {
                Log.Debug("Utility", "Time conversion assuming time is in Milliseconds: {0}, {1}", epochTime, ex.Message);
                dateTime = dateTime.AddMilliseconds(epochTime).ToLocalTime();
            }
            return dateTime;
        }
public static DateTime GetLocalDateTimeFromEpoch ( double epochTime ) { DateTime dateTime = new DateTime ( 1970 , 1 , 1 , 0 , 0 , 0 , 0 , System . DateTimeKind . Utc ) ; try { dateTime = dateTime . AddSeconds ( epochTime ) . ToLocalTime ( ) ; } catch ( ArgumentOutOfRangeException ex ) { Log . Debug ( " " , " " , epochTime , ex . Message ) ; dateTime = dateTime . AddMilliseconds ( epochTime ) . ToLocalTime ( ) ; } return dateTime ; }
Gets the date time from epoch.
Gets the date time from epoch .
The date time from epoch.
The date time from epoch .
epochTime
double
None
kind
None