Datasheet
Time_dateDiff
575
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
long Time_dateDiff(TimeStruct *t1, TimeStruct *t2);
Returns Time difference in seconds as a signed long.
Description
This function compares two dates and returns time difference in seconds as a
signed long. Result is positive if t1 is before t2, result is null if t1 is the same
as t2 and result is negative if t1 is after t2.
Parameters :
- t1: time and date structure (the first comparison parameter)
- t2: time and date structure (the second comparison parameter)
Note: This function is implemented as macro in the timelib.h header file which
can be found in the mikroC PRO for AVR Time Library Demo example folder.
Requires Nothing.
Example
#include "timelib.h"
...
TimeStruct ts1, ts2;
long diff ;
...
/*
* how many seconds between these two dates contained in ts1 and
ts2 buffers?
*/
diff = Time_dateDiff(&ts1, &ts2) ;