Page 1 of 1

Setting the current time...Help

Posted: Sat Jun 06, 2009 8:46 am
by Steelponies
Hey, I thought I would have got this working by now, but NB Time function
documentation is lacking any practical examples. I have used almost every
C code example on the web to get time I set from my SB72EX. I can modify
tm struct without a problem but I alway end up with a static time value
or overwrite the time I set with the dreaded Epoch time from Jan 1 1970.
Im using Network SDk from 2005 and I dont have RTC.h

I also read that time.h and nbtime.h will be needed but cant co exist,
What is the real deal with that?

Can anyone point me at a plain and simple practical example of setting the time
with set_time or any other Netburner method?

Thanks,
Sp

Re: Setting the current time...Help

Posted: Sat Jun 06, 2009 7:36 pm
by rnixon
Sounds like your release is really old so I can't help with api calls, but you can get or set the Secs variable any time you want, which is updated each second. You could then set it to the current time, and read it when you need to know. I know with the current tools you can also use NTP to set the time.

Re: Setting the current time...Help

Posted: Sun Jun 07, 2009 6:52 pm
by Steelponies
Im halfway through my app and would like to finish up without an upgrade if possible.
My interest is in Brokendown time or "Calendar time", but will be triyg things as you said.
The NTP code works very well I have had that working, but I would like to have a
default way to set user time and have the user option to use NTP.

Thanks for the reply,
Sp