public static void Main()
DateTime EpochTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime utcNow = DateTime.UtcNow;
int unixTime = (int)utcNow.Subtract(EpochTime).TotalSeconds;
int secondsOffset = -DAY;
int otherTime = unixTime + secondsOffset;
DateTime otherDateTime = EpochTime.AddSeconds(otherTime);
TimeSpan timeUntil = (otherTime - unixTime) > 0 ? TimeSpan.FromSeconds(otherTime - unixTime) : TimeSpan.FromSeconds(0);
TimeSpan timePast = (unixTime - otherTime) > 0 ? TimeSpan.FromSeconds(unixTime - otherTime) : TimeSpan.FromSeconds(0);
Console.WriteLine(string.Format("Now: -- {0}", unixTime));
Console.WriteLine(string.Format("Other: -- {0} -- ", otherTime));
Console.WriteLine(string.Format("NowDT: -- {0} -- ", utcNow));
Console.WriteLine(string.Format("OtherDT: -- {0} -- ", otherDateTime));
Console.WriteLine(string.Format("TimeUntil: -- {0} -- ", timeUntil));
Console.WriteLine(string.Format("TimePast: -- {0} -- ", timePast));