Meridianmeridian

RFC 2822

datetime.timestamp.rfc_2822

Email header datetime format. Used in SMTP, HTTP headers, and RSS feeds. Includes abbreviated weekday and month names.

Domain
datetime
Category
timestamp
Casts to
TIMESTAMPTZ
Scope
Universal

Try it

CLI
$ finetype infer -i "Tue, 15 Jan 2024 10:30:00 GMT+00:00"
→ datetime.timestamp.rfc_2822

DuckDB

Detect
SELECT finetype('Tue, 15 Jan 2024 10:30:00 GMT+00:00');
-- → 'datetime.timestamp.rfc_2822'
Cast expression
strptime({col}, '%a, %d %b %Y %H:%M:%S %z')
-- Format: %a, %d %b %Y %H:%M:%S %z
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS TIMESTAMPTZ) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.timestamp.rfc_2822';

JSON Schema

finetype schema datetime.timestamp.rfc_2822
{
  "$id": "https://meridian.online/schemas/datetime.timestamp.rfc_2822",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Email header datetime format. Used in SMTP, HTTP headers, and RSS feeds. Includes abbreviated weekday and month names.",
  "examples": [
    "Tue, 15 Jan 2024 10: 30: 00 GMT+00: 00",
    "Sun, 31 Dec 2023 23: 59: 59 GMT+00: 00"
  ],
  "pattern": "^[A-Z][a-z]{2}, \\d{2} [A-Z][a-z]{2} \\d{4} \\d{2}:\\d{2}:\\d{2} .+$",
  "title": "RFC 2822",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-format-string": "%a, %d %b %Y %H:%M:%S %z",
  "x-finetype-transform": "strptime({col}, '%a, %d %b %Y %H:%M:%S %z')"
}

Examples

Tue, 15 Jan 2024 10:30:00 GMT+00:00Sun, 31 Dec 2023 23:59:59 GMT+00:00