💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
ngx.parse_http_time ------------------- **语法:** *sec = ngx.parse_http_time(str)* **内容:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.** 解析 http 时间字符串(比如从 [ngx.http_time](#ngxhttp_time) 返回内容)。成功情况下返回秒数,错误的输入字符格式返回 `nil` 。 ```lua local time = ngx.parse_http_time("Thu, 18 Nov 2010 11:27:35 GMT") if time == nil then ... end ``` [返回目录](#nginx-api-for-lua) > English source: ngx.parse_http_time ------------------- **syntax:** *sec = ngx.parse_http_time(str)* **context:** *init_worker_by_lua*, set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.** Parse the http time string (as returned by [ngx.http_time](#ngxhttp_time)) into seconds. Returns the seconds or `nil` if the input string is in bad forms. ```nginx local time = ngx.parse_http_time("Thu, 18 Nov 2010 11:27:35 GMT") if time == nil then ... end ``` [Back to TOC](#nginx-api-for-lua)