Time Stamping

I have following module:
Arduino, Sensor, Real time clock, Memory

I am wondering what is the best way to time stamp sensor data with timing info from RTC before storing it on memory. Any suggestions, sample code, etc.

You don't actually time-stamp the data. You associate a time with the data, when storing it in memory.

The best way to do that depends on the system that will care about the time stamps. You have not given us a clue about that.

I would use an epoch time calculation. Pick an epoch and calculate the number
of seconds since that epoch. The epoch used on a lot of UNIX systems is 00:00 Jan 1, 1970, Greenwich Mean Time

Using epoch time it is easier to perform time and date calculations. IIRC there is a library
the converts local times to epoch times and back.

(* jcl *)


www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org