User manual

mikroPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
682
Time_epochToDate
Prototype
procedure Time_epochToDate(e : longint; var ts : TimeStruct);
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
var ts2 : TimeStruct;
epoch : longint;
...
//what date is epoch 1234567890 ?
epoch := 1234567890 ;
Time_epochToDate(epoch,ts2);
Notes None.
Time_dateDiff
Prototype
function Time_dateDiff(var t1, t2 : TimeStruct) : longint ;
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
var ts1, ts2 : TimeStruct;
diff : longint;
...
//how many seconds between these two dates contained in ts1 and ts2
buffers?
diff := Time_dateDiff(ts1, ts2);
Notes None.