I have 2 functions to convert between .NET DateTime and Unix timestamp. But I am not sure if I have taken timezones ( of the EPOCH and DateTime parameter) into account. Please help:
public class Util
{
    static DateTime EPOCH = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
    public static DateTime ConvertUnixTimeStamp(ulong unixTimeStamp)
    {
        var dt = EPOCH.AddSeconds(unixTimeStamp);
        return dt;
    }
    public static double ConvertDatetimeToUnixTimeStamp(DateTime dt)
    {
        TimeSpan t = (dt - EPOCH);
        return Math.Floor(t.TotalSeconds);
    }
}
 
    