[En-Nut-Discussion] Always getting the same time using time() call

Harald Kipp harald.kipp at egnite.de
Thu Jul 10 14:00:04 CEST 2008


Ole Reinhardt wrote:
> 
> Up to this point everything seems ok. I can live with a wrong date, nut
> now my problem: The time() call always returns the _same_ time:
> 30.11.1999 at 01:00:00
> 
> So what's going wrong here?

The RTC hardware will not start unless a new time has been set after 
power fail. Thus, if the time server was not reachable and a new time 
hasn't been set, you'll always get the same time.

After power failure you should either try one or more time servers until 
you can reach one, or set the RTC to a hardcoded time to clear the power 
fail flag.

Not investigated to the details, but that's what I can remember.

Harald





More information about the En-Nut-Discussion mailing list