BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

Data Structures

struct  pj_time_val
 
struct  pj_parsed_time
 

Macros

#define PJ_TIME_VAL_MSEC(t)
 
#define PJ_TIME_VAL_EQ(t1, t2)
 
#define PJ_TIME_VAL_GT(t1, t2)
 
#define PJ_TIME_VAL_GTE(t1, t2)
 
#define PJ_TIME_VAL_LT(t1, t2)
 
#define PJ_TIME_VAL_LTE(t1, t2)
 
#define PJ_TIME_VAL_ADD(t1, t2)
 
#define PJ_TIME_VAL_SUB(t1, t2)
 

Functions

pj_status_t pj_gettimeofday (pj_time_val *tv)
 
pj_status_t pj_time_decode (const pj_time_val *tv, pj_parsed_time *pt)
 
pj_status_t pj_time_encode (const pj_parsed_time *pt, pj_time_val *tv)
 
pj_status_t pj_time_local_to_gmt (pj_time_val *tv)
 
pj_status_t pj_time_gmt_to_local (pj_time_val *tv)
 
void pj_time_val_normalize (pj_time_val *t)
 

Detailed Description

This module provides API for manipulating time.

Examples

For examples, please see:

Macro Definition Documentation

◆ 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
t1The time value to add.
t2The 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
t1The first time value to compare.
t2The 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
t1The first time value to compare.
t2The 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
t1The first time value to compare.
t2The 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
t1The first time value to compare.
t2The 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
t1The first time value to compare.
t2The 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
tThe time value.
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
t1The time value to subsctract.
t2The time value to be substracted from t1.

Function Documentation

◆ pj_gettimeofday()

pj_status_t pj_gettimeofday ( pj_time_val tv)

Get current time of day in local representation.

Parameters
tvVariable to store the result.
Returns
zero if successfull.

◆ pj_time_decode()

pj_status_t pj_time_decode ( const pj_time_val tv,
pj_parsed_time pt 
)

Parse time value into date/time representation.

Parameters
tvThe time.
ptVariable to store the date time result.
Returns
zero if successfull.

◆ pj_time_encode()

pj_status_t pj_time_encode ( const pj_parsed_time pt,
pj_time_val tv 
)

Encode date/time to time value.

Parameters
ptThe date/time.
tvVariable to store time value result.
Returns
zero if successfull.

◆ pj_time_gmt_to_local()

pj_status_t pj_time_gmt_to_local ( pj_time_val tv)

Convert GMT to local time.

Parameters
tvTime to convert.
Returns
zero if successfull.

◆ pj_time_local_to_gmt()

pj_status_t pj_time_local_to_gmt ( pj_time_val tv)

Convert local time to GMT.

Parameters
tvTime to convert.
Returns
zero if successfull.

◆ pj_time_val_normalize()

void pj_time_val_normalize ( pj_time_val t)

Normalize the value in time value.

Parameters
tTime value to be normalized.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.