sqlite-http icon indicating copy to clipboard operation
sqlite-http copied to clipboard

`http_headers_date` function

Open asg017 opened this issue 4 years ago • 0 comments
trafficstars

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 ...;

asg017 avatar Oct 27 '21 05:10 asg017