Skip to content

RFC 2822

Type Registry

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 datetimetimestamp
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://noon.sh/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"
}

Examples

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

Types in datetime