Apache HTTPD
Macros | Functions
Date-time handling functions

Macros

#define AP_TIME_RECENT_THRESHOLD   15
 
#define AP_CTIME_OPTION_NONE   0x0
 
#define AP_CTIME_OPTION_USEC   0x1
 
#define AP_CTIME_OPTION_COMPACT   0x2
 
#define AP_CTIME_OPTION_GMTOFF   0x4
 

Functions

apr_status_t ap_explode_recent_localtime (apr_time_exp_t *tm, apr_time_t t)
 
apr_status_t ap_explode_recent_gmt (apr_time_exp_t *tm, apr_time_t t)
 
apr_status_t ap_recent_ctime (char *date_str, apr_time_t t)
 
apr_status_t ap_recent_ctime_ex (char *date_str, apr_time_t t, int option, int *len)
 
apr_status_t ap_recent_rfc822_date (char *date_str, apr_time_t t)
 

Detailed Description

Macro Definition Documentation

◆ AP_CTIME_OPTION_COMPACT

#define AP_CTIME_OPTION_COMPACT   0x2

Definition at line 49 of file util_time.h.

◆ AP_CTIME_OPTION_GMTOFF

#define AP_CTIME_OPTION_GMTOFF   0x4

Definition at line 51 of file util_time.h.

◆ AP_CTIME_OPTION_NONE

#define AP_CTIME_OPTION_NONE   0x0

Definition at line 45 of file util_time.h.

◆ AP_CTIME_OPTION_USEC

#define AP_CTIME_OPTION_USEC   0x1

Definition at line 47 of file util_time.h.

◆ AP_TIME_RECENT_THRESHOLD

#define AP_TIME_RECENT_THRESHOLD   15

Definition at line 41 of file util_time.h.

Function Documentation

◆ ap_explode_recent_gmt()

apr_status_t ap_explode_recent_gmt ( apr_time_exp_t tm,
apr_time_t  t 
)

convert a recent time to its human readable components in GMT timezone

Parameters
tmthe exploded time
tthe time to explode: MUST be within the last AP_TIME_RECENT_THRESHOLD seconds
Note
This is a faster alternative to apr_time_exp_gmt that uses a cache of pre-exploded time structures. It is useful for things that need to explode the current time multiple times per second, like loggers.
Returns
APR_SUCCESS iff successful

Definition at line 152 of file util_time.c.

◆ ap_explode_recent_localtime()

apr_status_t ap_explode_recent_localtime ( apr_time_exp_t tm,
apr_time_t  t 
)

convert a recent time to its human readable components in local timezone

Parameters
tmthe exploded time
tthe time to explode: MUST be within the last AP_TIME_RECENT_THRESHOLD seconds
Note
This is a faster alternative to apr_time_exp_lt that uses a cache of pre-exploded time structures. It is useful for things that need to explode the current time multiple times per second, like loggers.
Returns
APR_SUCCESS iff successful

Definition at line 146 of file util_time.c.

◆ ap_recent_ctime()

apr_status_t ap_recent_ctime ( char date_str,
apr_time_t  t 
)

format a recent timestamp in the ctime() format.

Parameters
date_strString to write to.
tthe time to convert
Note
Consider using ap_recent_ctime_ex instead.
Returns
APR_SUCCESS iff successful

Definition at line 158 of file util_time.c.

◆ ap_recent_ctime_ex()

apr_status_t ap_recent_ctime_ex ( char date_str,
apr_time_t  t,
int  option,
int len 
)

format a recent timestamp in an extended ctime() format.

Parameters
date_strString to write to.
tthe time to convert
optionAdditional formatting options (AP_CTIME_OPTION_*).
lenPointer to an int containing the length of the provided buffer. On successful return it contains the number of bytes written to the buffer (including trailing NUL byte).
Returns
APR_SUCCESS iff successful, APR_ENOMEM if buffer was to short.

Definition at line 164 of file util_time.c.

◆ ap_recent_rfc822_date()

apr_status_t ap_recent_rfc822_date ( char date_str,
apr_time_t  t 
)

format a recent timestamp in the RFC822 format

Parameters
date_strString to write to (must have length >= APR_RFC822_DATE_LEN)
tthe time to convert

Definition at line 282 of file util_time.c.