2004-09-28 16:34:51 +08:00
|
|
|
|
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2012-01-18 23:07:43 +08:00
|
|
|
* Copyright (C) Nginx, Inc.
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-11-11 05:09:22 +08:00
|
|
|
#ifndef _NGX_TIMES_H_INCLUDED_
|
|
|
|
#define _NGX_TIMES_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
|
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
typedef struct {
|
|
|
|
time_t sec;
|
|
|
|
ngx_uint_t msec;
|
|
|
|
ngx_int_t gmtoff;
|
|
|
|
} ngx_time_t;
|
|
|
|
|
|
|
|
|
2005-03-04 22:06:57 +08:00
|
|
|
void ngx_time_init(void);
|
2010-03-25 17:10:10 +08:00
|
|
|
void ngx_time_update(void);
|
|
|
|
void ngx_time_sigsafe_update(void);
|
2004-10-21 23:34:38 +08:00
|
|
|
u_char *ngx_http_time(u_char *buf, time_t t);
|
|
|
|
u_char *ngx_http_cookie_time(u_char *buf, time_t t);
|
2003-11-13 14:14:05 +08:00
|
|
|
void ngx_gmtime(time_t t, ngx_tm_t *tp);
|
2003-11-11 05:09:22 +08:00
|
|
|
|
2008-08-11 23:28:15 +08:00
|
|
|
time_t ngx_next_time(time_t when);
|
|
|
|
#define ngx_next_time_n "mktime()"
|
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
extern volatile ngx_time_t *ngx_cached_time;
|
2004-06-28 02:01:57 +08:00
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
#define ngx_time() ngx_cached_time->sec
|
|
|
|
#define ngx_timeofday() (ngx_time_t *) ngx_cached_time
|
2003-11-11 05:09:22 +08:00
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
extern volatile ngx_str_t ngx_cached_err_log_time;
|
|
|
|
extern volatile ngx_str_t ngx_cached_http_time;
|
|
|
|
extern volatile ngx_str_t ngx_cached_http_log_time;
|
2011-03-16 23:46:57 +08:00
|
|
|
extern volatile ngx_str_t ngx_cached_http_log_iso8601;
|
2014-05-12 20:34:15 +08:00
|
|
|
extern volatile ngx_str_t ngx_cached_syslog_time;
|
2004-01-30 05:45:01 +08:00
|
|
|
|
|
|
|
/*
|
2005-10-07 21:30:52 +08:00
|
|
|
* milliseconds elapsed since epoch and truncated to ngx_msec_t,
|
|
|
|
* used in event timers
|
2004-01-30 05:45:01 +08:00
|
|
|
*/
|
2005-10-19 20:33:58 +08:00
|
|
|
extern volatile ngx_msec_t ngx_current_msec;
|
2004-01-30 05:45:01 +08:00
|
|
|
|
2003-11-11 05:09:22 +08:00
|
|
|
|
|
|
|
#endif /* _NGX_TIMES_H_INCLUDED_ */
|