using System;
using System.Runtime.InteropServices;
namespace E
{
public class Program
{
private static readonly DateTime epoch = new DateTime(1970, 1,
1, 0, 0, 0, DateTimeKind.Utc);
[DllImport("msvcrt.dll")]
public static extern long time(IntPtr t);
public static void Main(string[] args)
{
long t = time(IntPtr.Zero);
DateTime now = epoch.AddSeconds(t).ToLocalTime();
Console.WriteLine(now);
Console.ReadKey();
}
}
}
Arne
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.