1
Fork 0

added code to reverse timestamp operation

This commit is contained in:
Jake Howard 2014-12-30 17:33:51 +00:00
parent e734383164
commit 1b6ba42639
1 changed files with 8 additions and 0 deletions

View File

@ -62,5 +62,13 @@ namespace Saviour_Backup_System
return BitConverter.ToString(md5.Hash).Replace("-", "").ToLower();
}
public static DateTime unixDateTime(long 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;
}
}
}