From 1b6ba426395e665acb8b13df94fe1bca5f37e4b4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 30 Dec 2014 17:33:51 +0000 Subject: [PATCH] added code to reverse timestamp operation --- Saviour Backup System/tools.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Saviour Backup System/tools.cs b/Saviour Backup System/tools.cs index 58fe991..42cd19d 100644 --- a/Saviour Backup System/tools.cs +++ b/Saviour Backup System/tools.cs @@ -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; + } } }