Forum Discussion
Altera_Forum
Honored Contributor
16 years agoNeed an information
Hello everyone, I need to fetch the current time when I use Nios II IDE (v.9.1). Can anyone write me the syntax in C language. I tried one but it does nothing. Thanks to all for your time...
Altera_Forum
Honored Contributor
16 years agoIf your system doesn't have an external battery powered RTC clock, it has no way of knowing the time. In that case it will start at January 1st 1970. To set the correct time at start-up, you can either use a client-server approach (port a NTP client and have it connect to an NTP server) or ask the user to type in the actual time and date.
Once the time is set, it will increase automatically and you can read it with gettimeofday or other time functions.