This module provides API for manipulating time.
Examples
For examples, please see:
◆ PJ_TIME_VAL_ADD
#define PJ_TIME_VAL_ADD |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
Add t2 to t1 and store the result in t1. Effectively
this macro will expand as: (t1 += t2).
- Parameters
-
t1 | The time value to add. |
t2 | The time value to be added to t1. |
◆ PJ_TIME_VAL_EQ
#define PJ_TIME_VAL_EQ |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
This macro will check if t1 is equal to t2.
- Parameters
-
t1 | The first time value to compare. |
t2 | The second time value to compare. |
- Returns
- Non-zero if both time values are equal.
◆ PJ_TIME_VAL_GT
#define PJ_TIME_VAL_GT |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
This macro will check if t1 is greater than t2
- Parameters
-
t1 | The first time value to compare. |
t2 | The second time value to compare. |
- Returns
- Non-zero if t1 is greater than t2.
◆ PJ_TIME_VAL_GTE
#define PJ_TIME_VAL_GTE |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
This macro will check if t1 is greater than or equal to t2
- Parameters
-
t1 | The first time value to compare. |
t2 | The second time value to compare. |
- Returns
- Non-zero if t1 is greater than or equal to t2.
◆ PJ_TIME_VAL_LT
#define PJ_TIME_VAL_LT |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
This macro will check if t1 is less than t2
- Parameters
-
t1 | The first time value to compare. |
t2 | The second time value to compare. |
- Returns
- Non-zero if t1 is less than t2.
◆ PJ_TIME_VAL_LTE
#define PJ_TIME_VAL_LTE |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
This macro will check if t1 is less than or equal to t2.
- Parameters
-
t1 | The first time value to compare. |
t2 | The second time value to compare. |
- Returns
- Non-zero if t1 is less than or equal to t2.
◆ PJ_TIME_VAL_MSEC
#define PJ_TIME_VAL_MSEC |
( |
|
t | ) |
|
Get the total time value in miliseconds. This is the same as multiplying the second part with 1000 and then add the miliseconds part to the result.
- Parameters
-
- Returns
- Total time in miliseconds.
◆ PJ_TIME_VAL_SUB
#define PJ_TIME_VAL_SUB |
( |
|
t1, |
|
|
|
t2 |
|
) |
| |
Substract t2 from t1 and store the result in t1. Effectively this macro will expand as (t1 -= t2).
- Parameters
-
t1 | The time value to subsctract. |
t2 | The time value to be substracted from t1. |
◆ pj_gettimeofday()
Get current time of day in local representation.
- Parameters
-
tv | Variable to store the result. |
- Returns
- zero if successfull.
◆ pj_time_decode()
Parse time value into date/time representation.
- Parameters
-
tv | The time. |
pt | Variable to store the date time result. |
- Returns
- zero if successfull.
◆ pj_time_encode()
Encode date/time to time value.
- Parameters
-
pt | The date/time. |
tv | Variable to store time value result. |
- Returns
- zero if successfull.
◆ pj_time_gmt_to_local()
Convert GMT to local time.
- Parameters
-
- Returns
- zero if successfull.
◆ pj_time_local_to_gmt()
Convert local time to GMT.
- Parameters
-
- Returns
- zero if successfull.
◆ pj_time_val_normalize()
Normalize the value in time value.
- Parameters
-
t | Time value to be normalized. |