On 04Oct2009 15:56, lslonim2 <lslonim@our3cats.
| Hi. I'm an embedded programmer, doing code for a board that is part of a distributed system that will interface to a Linux central controller. My board does not run an OS.
| I need to send time and date info from an on-board battery backed clock to the Linux system for time-stamping events, and it needs to send me info if my clock has a dead battery.
| I'm trying to find out what format Linux wants, so that when I send it up to central, the guy handling that end will have less work to do. There's nobody to ask yet since that job isn't filled.
| My clock chip is hh:mm:ss. In searching the web, it seems Linux time is kept as a raw time since 1970, but my little processor can't handle the work to go into and out of that format.
| So my question is: Is there a standard Linux format for transmitting time in hh:mm:ss format, and if so, what are the system calls that use it?
Just send hh:mm:ss and make sure your Linux guy knows the format. It's
pretty trivial to convert a "human" time into a UNIX seconds-since-
on the Linux machine using standard library calls present on all UNIX
machines, specificly the ones using the "tm" struct.
If you only have hh:mm:ss then the Linux end will have to assume today's date
but that's easily done. It will also need to know the timezone your embedded
box is using (personally I would go with GMT/UTC if you can trust the people
configuring your board to set it correctly - no summer time issues or other
things to worry about).
Cheers,
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.
Theoretical Physicist,N.
the numbers balance but who is never actually observed in the laboratory.
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
No comments:
Post a Comment