[En-Nut-Discussion] problem with date 31.8.2005
Dave
ethernut at wormfood.org
Wed Aug 31 12:49:21 CEST 2005
Hi Peter,
> Setting date = 31.08.2005 and time = 8:41 yields a value of 1128152460
> for "my_time". But the printf_P shows "01.09.2005 08:41:00"!
1128152460 should have been your biggest clue that something was wrong
with your program, because 1128152460 translates to Saturday, October
1st 2005, 7:41:00 (GMT).
> What's going wrong?
Its a loose screw between your chair and your keyboard. ;)
You'll probably want to kick yourself after you read this page.
http://ethernut.de/api/struct__tm.html which in part says tm_mon =
months since January - [0,11]. You've been a month off all along.
Why not run the sntp server to keep the clock set automagically for you?
That is what I do, and it works great.
-Dave
More information about the En-Nut-Discussion
mailing list