// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static void Main(string[] args) { long k = (new DateTime(1970, 1, 1, 0, 0, 0) + TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)).Ticks; long msepoch = (DateTime.Now.Ticks - k) / 10000; Console.WriteLine(msepoch); DateTime dt = new DateTime(msepoch * 10000 + k); Console.WriteLine(dt.ToString("dd/MM/yyyy HH:mm")); } } }