代码改变世界

随笔档案-2011年11月30日

Nginx 中ngx_gmtime函数小析

2011-11-30 14:26 by cdamo, 868 阅读, 收藏,
摘要: Nginx 中ngx_gmtime函数小析最近开始看nginx原码,从main()函数开始,看到ngx_gmtime()函数时,发现有些地方看不明白.voidngx_gmtime(time_t t, ngx_tm_t *tp){ ngx_int_t yday; ngx_uint_t n, sec, min, hour, mday, mon, year, wday, days, leap; /* the calculation is valid for positive time_t only */ n = (ngx_uint_t) t; days = n / 86400; /* Jaunary 阅读全文