How to get RTC(Real time clock) time using c#?
-
I want to get RTC(Real time clock) time in c#. How can i do that? Thank for your answer. :)
DateTime.Now
Simon
-
DateTime.Now
Simon
-
Where do you think the OS gets it's time from? The RTC is a bit of hardware that keeps track of the time while the PC is powered off. When the PC is powered on again, the time in the RTC is loaded and used by the OS. Depending on the OS, it may then rely on the RTC to count the time, and make a call to the hardware when over the time is needed, or it may keep track of the time using itself a software clock/counter. Either way, the value you get returned to you is the current time as far as the system as a whole is concerned. There is no need to distinguish between "OS time" and "RTC time" one is simply used to back the other. Unless you have a very strange and unusual requirement where you must have the actual hardware RTC value, just use DateTime.Now.
Simon