User manual

Table Of Contents
654
mikoC PRO for PIC32
MikroElektronika
Time_epochToDate
Prototype
void Time_epochToDate(long e, TimeStruct *ts);
Description Converts the UNIX time to time and date.
Parameters - e: UNIX time (seconds since UNIX epoch)
- ts: time and date structure for storing conversion output
Returns Nothing.
Requires Nothing.
Example
#include “__Time.h”
...
TimeStruct ts2;
long epoch ;
...
//what date is epoch 1234567890 ?
epoch = 1234567890 ;
Time_epochToDate(epoch, &ts2) ;
Notes None.
Time_dateDiff
Prototype
long Time_dateDiff(TimeStruct *t1, TimeStruct *t2);
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 rst comparison parameter)
- t2: time and date structure (the second comparison parameter)
Parameters None.
Returns Time difference in seconds as a signed long.
Requires Nothing.
Example
#include “__Time.h”
...
TimeStruct ts1, ts2;
long diff ;
...
// how many seconds between these two dates is contained in ts1 and ts2
buffers?
diff = Time_dateDiff(&ts1, &ts2) ;
Notes None.