asg017/sqlite-http

`http_headers_date` function

asg017 opened this issue · 0 comments

to parse common headers date formated as Tue, 26 Oct 2021 05:15:58 GMT

sqlite datetime can't parse this on it's own, so it's annoying. this func would format it for use with other sqlite datetime utils

date, last modified, etc

https://httpwg.org/specs/rfc7231.html#http.date

Option #1

select 
  http_headers_date(response_headers), 
  http_headers_date(response_headers, 'last-modified') 
from ...;

Option #2

select 
  http_headers_date(
    http_headers_get(response_headers, 'Date')
  ),
  http_headers_date(
    http_headers_get(response_headers, 'Last-Modified')
  )
from ...;