As per MSDN, In C++/C time(NULL) function returns the time elapsed in seconds since midnight, January 1, 1970, which is Coordinated Universal Time (UTC) according to the system clock - is the current time, precisely. To achieve the same in C#, code should look something similar like as below: